~ubuntu-branches/ubuntu/karmic/sanduhr/karmic

« back to all changes in this revision

Viewing changes to idl/README

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Voss
  • Date: 2002-04-12 16:33:03 UTC
  • Revision ID: james.westby@ubuntu.com-20020412163303-xn0v3utm5xcyux60
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
This directory contains the CORBA IDL file for SandUhr
 
2
 
 
3
 
 
4
In the following I will describe the semantics for
 
5
the various attributes and methods of the SandUhr
 
6
CORBA interface.  The directory remote/ of the SandUhr
 
7
source code distribution contains example code, which
 
8
illustrates the use of this interface.
 
9
 
 
10
 
 
11
The central part of SandUhr is the 'Timer' interface.
 
12
It represents the sand-glass-shaped window and every piece
 
13
of information associated to it.
 
14
 
 
15
* enum TimerState { TSPrepare, TSRunning, TSDone };
 
16
  readonly attribute TimerState State;
 
17
 
 
18
        The state of the timer.  This is 'TSPrepare' if the timer is
 
19
        not yet running (e.g. while the initial setup window is
 
20
        showing), 'TSRunning' during normal operation, and 'TSDone'
 
21
        after the timer elapsed (i.e. while the alarm is delivered).
 
22
 
 
23
* attribute string TimeSpec;
 
24
 
 
25
        The alarm time as a time specification string.  The format of
 
26
        this string is explained in the SandUhr Manual.
 
27
 
 
28
* attribute string Message;
 
29
 
 
30
        The alarm message.  This is passed to the alarm action
 
31
        for delivery.
 
32
 
 
33
* attribute AlarmAction Alarm;
 
34
 
 
35
        The alarm action.  There are several subclasses of AlarmAction
 
36
        available.  These are described below.
 
37
 
 
38
* struct Color {
 
39
    unsigned short Red, Green, Blue;
 
40
  };
 
41
  attribute Color SandColor;
 
42
 
 
43
        The fill color of the sand glass.  The Red, Green, and Blue
 
44
        values may lay in the range 0 to 255 inclusive.
 
45
 
 
46
* attribute boolean WindowDecorations;
 
47
  enum Layer { LayerDesktop, LayerBelow, LayerNormal, LayerOntop };
 
48
  attribute Layer WindowLayer;
 
49
 
 
50
        These fields describe the interaction with the window manager.
 
51
        They control the corresponding GNOME window manager hints.
 
52
 
 
53
* void Destroy ();
 
54
 
 
55
        Destroy the currently running timer without delivering the
 
56
        alarm.
 
57
 
 
58
* unsigned long TimeLeft () raises (NotRunning);
 
59
 
 
60
        Return the number of seconds left until the alarm is
 
61
        delivered.  The NotRunning exception is raised if
 
62
        the timer's state is not TSRunning.
 
63
 
 
64
 
 
65
The Alarm action is described by Objects of type AlarmAction.
 
66
 
 
67
* readonly attribute boolean NeedsPopup;
 
68
 
 
69
        If this is true, the Timer will display the alarm message in a
 
70
        popup window in addition to the Deliver() call.
 
71
 
 
72
* void Attach (in Timer T);
 
73
 
 
74
        This is called by a Timer object, before it accesses the
 
75
        AlarmAction object in any other way.  It may be used to
 
76
        implement reference counting for alarm actions.
 
77
 
 
78
* void Detach (in Timer T);
 
79
 
 
80
        This is called by the Timer object when the Timer is no longer
 
81
        interested in this AlarmAction.  This occurs after the Deliver()
 
82
        call or after the AlarmAction is replaced with another one.
 
83
        This method may be used to implement reference counting for
 
84
        alarm actions.
 
85
 
 
86
* void Deliver (in string TimeSpec, in string Message);
 
87
 
 
88
        This method is called by the timer to actually deliver the
 
89
        alarm.  The function is responsible for delivering the alarm
 
90
        to the user.  If the delivery fails it must raise the
 
91
        DeliveryFailed exception.  Note that the TimeSpec contains a
 
92
        normalized form of the alarm time, not the originial time
 
93
        specification.
 
94
 
 
95
 
 
96
SandUhr implements three subclasses of AlarmAction:
 
97
 
 
98
* interface AlarmBeep: AlarmAction {
 
99
    attribute unsigned short Count;
 
100
  };
 
101
 
 
102
        Ring the keybord bell repeatedly.  Count is the number of beeps.
 
103
        It is decreased while the alarm is delivered until the value
 
104
        reaches 0.
 
105
 
 
106
* interface AlarmSound: AlarmAction {
 
107
    attribute string SoundFile;
 
108
  };
 
109
 
 
110
        Playes a sound file via the enlightened sound daemon esd.
 
111
        The file name 'SoundFile' must denote a file on the host
 
112
        the AlarmSound object lives on.
 
113
 
 
114
* interface AlarmCommand: AlarmAction {
 
115
    attribute string CommandString;
 
116
  };
 
117
 
 
118
        Execute an arbitrary shell command.  This command is executed
 
119
        via 'gnome_execute_shell' on the host the AlarmCommand object
 
120
        lives on.
 
121
 
 
122
 
 
123
To create Alarm and Timer objects you should use the TimerFactory
 
124
interface.  It is derived from GNOME::ObjectFactory.  The TimerFactory
 
125
represents the control window and all resources associated with it.
 
126
TimerFactory objects are registered with the GNOME object activation
 
127
framework OAF.
 
128
 
 
129
* AlarmBeep CreateAlarmBeep (in unsigned short Count);
 
130
  AlarmSound CreateAlarmSound (in string SoundFile);
 
131
  AlarmCommand CreateAlarmCommand (in string CommandString);
 
132
 
 
133
        Create an AlarmAction object.  This may be assigned to
 
134
        a timer's Alarm attribute.
 
135
 
 
136
* Timer CreateTimer (in string TimeSpec, in string Message)
 
137
                                                raises (InvalidTime);
 
138
 
 
139
        Create a new Timer object.  The alarm time is described by
 
140
        TimeSpec.  The format of this string is explained in the
 
141
        SandUhr Manual.  If TimeSpec is the empty string, open a
 
142
        window to query the user for an alarm time.  If TimeSpec is not
 
143
        a valid alarm time specification, the InvalidTime exception is
 
144
        raised.
 
145
 
 
146
* typedef sequence<Timer> TimerVec;
 
147
  readonly attribute TimerVec Timers;
 
148
 
 
149
        This is the list of timers, which are under control of the
 
150
        factory object.
 
151
 
 
152
* void ShowControl (in boolean Show);
 
153
 
 
154
        Show or hide the Control window, which is associated with the
 
155
        timer factory.