summaryrefslogtreecommitdiff
path: root/docs/qcop.doc
blob: e62f91d9a072bf232d9c76d4fb8fafcf3152718b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*!

\page qcop.html

\title QCop Messages

QCop messages allow applications to communicate with each other.
These messages are send using QCopEnvelope, and received by connecting
to a QCopChannel.

The <tt>channelname</tt> of channels within Qtopia all start with "QPE/".
The <tt>messagename</tt> is a function identifier followed by a list of types
in parentheses. There are no spaces in the message name.

The variable names shown in this documentation are purely for information
purposes.  A message shown as
"messageName(Type1 varname1, Type2 varname2, Type2 varname3)" would be
used in program code as:

\code
   QCopEnvelope e(channelname, "messageName(Type1,Type2,Type2)");
   e << parameter1 << parameter2 << parameter3;
\endcode


The system-wide channels and messages.

<dl>
<dt><b>QPE/System</b>
 <dd>
  <ul>
    <li>busy()
	<br> Causes a wait indicator to be shown to the user.
    <li>notBusy()
	<br> Cancels the wait indicator.
    <li>linkChanged(QString)
	<br> Sent whenever a link is changed.
	    It is sent by FileManager::saveFile() and others, and
	    received by the Launcher.
    <li>applyStyle()
	<br> Sent when user changes style.
	    It is received by QPEApplication and the application
	    will redraw accordingly.
    <li>quit()
	<br> Terminates the Qtopia environment.
    <li>shutdown()
	<br> Terminates the system.
    <li>restart()
	<br> Restarts the Qtopia environment.
    <li>execute(QString)
	<br> Executes or raises the given application.
    <li>execute(QString,QString)
	<br> Executes or raises the given application, passing an argument.
	    Note that you should consider using the 
	    <b>QPE/Application/<i>appname</i></b> channels described below.
    <li>addAlarm(QDateTime,QCString,QCString,int)
	<br> Internal. See AlarmServer::addAlarm()
    <li>deleteAlarm(QDateTime,QCString,QCString,int)
	<br> Internal. See AlarmServer::deleteAlarm()
    <li>setDefaultRotation(int)
	<br> Internal.
    <li>grabKeyboard(QString)
	<br> Internal.
    <li>timeChange(QString)
	<br> Internal.
    <li>clockChange(bool)
	<br> Internal.
    <li>setScreenSaverInterval(int)
	<br> Internal.
    <li>language(QString)
	<br> Internal.
  </ul>

<dt><b>QPE/Sync</b>
 <ul>
    <li>flush()
	<br> Sent at the start of synchronization. Synchable applications
	    should save any synchable data to disk.
	    <i>Note: this message is currently asynchronous. Stay tuned
		to discussions regarding synchronization, as this message
		may become synchronous, requiring slight midification to
		your code. For now, just respond in a timely fashion,
		since the sync server merely waits a small time.</i>
    <li>reload()
	<br> Sent at the end of synchronization. Synchable applications
            should reload any synchable data from disk.
 </ul>

<dt><b>QPE/TaskBar</b>
 <ul>
    <li>message(QString)
	<br> Internal. See Global::statusMessage()
    <li>showInputMethod()
	<br> Internal.
    <li>hideInputMethod()
	<br> Internal.
    <li>reloadInputMethods()
	<br> Internal.
    <li>reloadApplets()
	<br> Internal.
 </ul>

<dt><b>QPE/Card</b>
 <ul>
    <li>stabChanged()
	<br> Sent when <tt>/var/run/stab</tt>, <tt>/var/state/pcmcia/stab</tt>,
		or <tt>/var/lib/pcmcia/stab</tt> may have changed.
    <li>netUp()
	<br> Sent when a network connection is running.
    <li>netDown()
	<br> Sent when a network connection is available, but not running.
    <li>netUnavailable()
	<br> Sent when a network connection is not available.
 </ul>

<dt><b>Qt/Tray</b>
 This channel allows Qt applications (not just Qtopia applications)
 to show system-tray status in a cross-platform manner,
 but it is not currently supported. See TaskbarAppletInterface for
 a more powerful alternative for system tray applications.
 <ul>
    <li>popup(int,QPoint)
    <li>remove(int)
    <li>setIcon(int,QPixmap)
    <li>setToolTip(int,QString)
    <li>doubleClicked(int,QPoint)
    <li>clicked(int,QPoint)
 </ul>
</dl>

Each application listens on a channel called
<b>QPE/Application/<i>appname</i></b>, where <b><i>appname</i></b> is
the executable name (the application identifier). Standard messages on
this channel are:

<dl>
 <dt><b>QPE/Application/<i>appname</i></b>
  <ul>
    <li>setDocument(QString)
	<br>Internal. Causes the setDocument(const QString&) slot
	    of <a href=docwidget.html>the main document widget</a>
	    to be called.
    <li>nextView()
	<br>Applications connected to hardware buttons will receive
	    this message if they are already visible.
    <li>raise()
	<br>Internal. Causes the the main document widget and the
	    current modal widget to be raised.
    <li>quit()
	<br>Internal. Terminates the application.
    <li>quitIfInvisible()
	<br>Internal. Terminates the application if it is not shown.
  </ul>
</dl>

The QPE/Application/<i>appname</i> channel has a special property: when
messages are sent to these channels vie QCopEnvelope, the message is
delivered even if the application is not yet running (the application
is run and the message is then sent).

Applications also respond to messages specific to the application.
Such messages in the base Qtopia applications are:

<dl>
 <dt><b>QPE/Application/helpbrowser</b>
  <ul>
   <li>showFile(QString <i>file</i>)
    <br>Send this message to have the Help Browser show a file.
	The <i>file</i> may be an absolute filename or relative
	to the system HTML documentation directory ($OPIEDIR/help/html).
  </ul>
 <dt><b>QPE/Application/datebook</b>
  <ul>
   <li>alarm(QDateTime,int)
    <br>Internal. Causes the Calendar application to sound alarms.
  </ul>
</dl>

*/