Home | History | Annotate | Download | only in ibus
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROMEOS_DBUS_IBUS_IBUS_CONSTANTS_H_
      6 #define CHROMEOS_DBUS_IBUS_IBUS_CONSTANTS_H_
      7 
      8 namespace chromeos {
      9 
     10 namespace ibus {
     11 
     12 const char kServiceName[] = "org.freedesktop.IBus";
     13 
     14 // Constants used to receive NameOwner signals from ibus-daemon. Note that
     15 // "org.freedesktop.DBus" is used instead of "org.freedesktop.IBus" for these
     16 // signals.
     17 const char kDBusServiceName[] = "org.freedesktop.DBus";
     18 const char kDBusObjectPath[] = "/org/freedesktop/DBus";
     19 const char kDBusInterface[] = "org.freedesktop.DBus";
     20 const char kGetNameOwnerMethod[] = "GetNameOwner";
     21 const char kNameOwnerChangedSignal[] = "NameOwnerChanged";
     22 
     23 namespace bus {
     24 const char kServicePath[] = "/org/freedesktop/IBus";
     25 const char kServiceInterface[] = "org.freedesktop.IBus";
     26 const char kCreateInputContextMethod[] = "CreateInputContext";
     27 const char kRegisterComponentMethod[] = "RegisterComponent";
     28 const char kSetGlobalEngineMethod[] = "SetGlobalEngine";
     29 const char kExitMethod[] = "Exit";
     30 }  // namespace bus
     31 
     32 namespace input_context {
     33 const char kServiceInterface[] = "org.freedesktop.IBus.InputContext";
     34 const char kCommitTextSignal[] = "CommitText";
     35 const char kForwardKeyEventSignal[] = "ForwardKeyEvent";
     36 const char kHidePreeditTextSignal[] = "HidePreeditText";
     37 const char kShowPreeditTextSignal[] = "ShowPreeditText";
     38 const char kUpdatePreeditTextSignal[] = "UpdatePreeditText";
     39 const char kDeleteSurroundingTextSignal[] = "DeleteSurroundingText";
     40 const char kFocusInMethod[] = "FocusIn";
     41 const char kFocusOutMethod[] = "FocusOut";
     42 const char kResetMethod[] = "Reset";
     43 const char kSetCapabilitiesMethod[] = "SetCapabilities";
     44 const char kSetCursorLocationMethod[] = "SetCursorLocation";
     45 const char kProcessKeyEventMethod[] = "ProcessKeyEvent";
     46 const char kSetSurroundingTextMethod[] = "SetSurroundingText";
     47 const char kPropertyActivateMethod[] = "PropertyActivate";
     48 }  // namespace input_context
     49 
     50 namespace engine_factory {
     51 const char kServicePath[] = "/org/freedesktop/IBus/Factory";
     52 const char kServiceInterface[] = "org.freedesktop.IBus.Factory";
     53 const char kCreateEngineMethod[] = "CreateEngine";
     54 }  // namespace engine factory
     55 
     56 namespace engine {
     57 const char kServicePathPrefix[] = "/org/freedesktop/IBus/Engine/";
     58 const char kServiceInterface[] = "org.freedesktop.IBus.Engine";
     59 const char kFocusInMethod[] = "FocusIn";
     60 const char kFocusOutMethod[] = "FocusOut";
     61 const char kEnableMethod[] = "Enable";
     62 const char kDisableMethod[] = "Disable";
     63 const char kPropertyActivateMethod[] = "PropertyActivate";
     64 const char kPropertyShowMethod[] = "PropertyShow";
     65 const char kPropertyHideMethod[] = "PropertyHide";
     66 const char kSetCapabilityMethod[] = "SetCapability";
     67 const char kResetMethod[] = "Reset";
     68 const char kProcessKeyEventMethod[] = "ProcessKeyEvent";
     69 const char kCandidateClickedMethod[] = "CandidateClicked";
     70 const char kSetSurroundingTextMethod[] = "SetSurroundingText";
     71 const char kRegisterPropertiesSignal[] = "RegisterProperties";
     72 const char kUpdatePreeditSignal[] = "UpdatePreeditText";
     73 const char kUpdateAuxiliaryTextSignal[] = "UpdateAuxiliaryText";
     74 const char kUpdateLookupTableSignal[] = "UpdateLookupTable";
     75 const char kUpdatePropertySignal[] = "UpdateProperty";
     76 const char kForwardKeyEventSignal[] = "ForwardKeyEvent";
     77 const char kRequireSurroundingTextSignal[] = "RequireSurroundingText";
     78 const char kCommitTextSignal[] = "CommitText";
     79 const char kDeleteSurroundingTextSignal[] = "DeleteSurroundingText";
     80 }  // namespace engine
     81 
     82 namespace panel {
     83 const char kServiceName[] = "org.freedesktop.IBus.Panel";
     84 const char kServicePath[] = "/org/freedesktop/IBus/Panel";
     85 const char kServiceInterface[] = "org.freedesktop.IBus.Panel";
     86 const char kUpdateLookupTableMethod[] = "UpdateLookupTable";
     87 const char kHideLookupTableMethod[] = "HideLookupTable";
     88 const char kUpdateAuxiliaryTextMethod[] = "UpdateAuxiliaryText";
     89 const char kHideAuxiliaryTextMethod[] = "HideAuxiliaryText";
     90 const char kUpdatePreeditTextMethod[] = "UpdatePreeditText";
     91 const char kHidePreeditTextMethod[] = "HidePreeditText";
     92 const char kRegisterPropertiesMethod[] = "RegisterProperties";
     93 const char kUpdatePropertyMethod[] = "UpdateProperty";
     94 const char kCandidateClickedSignal[] = "CandidateClicked";
     95 const char kCursorUpSignal[] = "CursorUp";
     96 const char kCursorDownSignal[] = "CursorDown";
     97 const char kPageUpSignal[] = "PageUp";
     98 const char kPageDownSignal[] = "PageDown";
     99 
    100 // Methods to be just ignored. We do not use these methods in the UI.
    101 // See http://crbug.com/164525.
    102 const char kFocusInMethod[] = "FocusIn";
    103 const char kFocusOutMethod[] = "FocusOut";
    104 const char kStateChangedMethod[] = "StateChanged";
    105 }  // namespace panel
    106 
    107 // Following variables indicate state of IBusProperty.
    108 enum IBusPropertyState {
    109   IBUS_PROPERTY_STATE_UNCHECKED = 0,
    110   IBUS_PROPERTY_STATE_CHECKED = 1,
    111   IBUS_PROPERTY_STATE_INCONSISTENT = 2,
    112 };
    113 
    114 // Following button indicator value is introduced from
    115 // http://developer.gnome.org/gdk/stable/gdk-Event-Structures.html#GdkEventButton
    116 enum IBusMouseButton {
    117   IBUS_MOUSE_BUTTON_LEFT = 1U,
    118   IBUS_MOUSE_BUTTON_MIDDLE = 2U,
    119   IBUS_MOUSE_BUTTON_RIGHT = 3U,
    120 };
    121 
    122 namespace config {
    123 const char kServiceName[] = "org.freedesktop.IBus.Config";
    124 const char kServicePath[] = "/org/freedesktop/IBus/Config";
    125 const char kServiceInterface[] = "org.freedesktop.IBus.Config";
    126 const char kSetValueMethod[] = "SetValue";
    127 }  // namespace config
    128 
    129 // We can't use ui/gfx/rect.h in chromeos/, so we should use ibus::Rect instead.
    130 struct Rect {
    131  Rect() : x(0), y(0), width(0), height(0) {}
    132  Rect(int x, int y, int width, int height)
    133      : x(x),
    134        y(y),
    135        width(width),
    136        height(height) {}
    137  int x;
    138  int y;
    139  int width;
    140  int height;
    141 };
    142 
    143 }  // namespace ibus
    144 }  // namespace chromeos
    145 
    146 #endif  // CHROMEOS_DBUS_IBUS_IBUS_CONSTANTS_H_
    147