LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sfx2 / doc / sfx2doc.html
blob2d796436068f78aed45e992d111df99b25fb22f0
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <BODY LANG="de-DE" DIR="LTR">
4 <P CLASS="western">Signal processing in the sfx2 Interface.
5 State of 5.5.2013<BR><BR>
6 related modules are: svidl (idl compiler), framework (command processing routines), rsc (resource compiler, see below), vcl (command processing routines)<BR>
7 Here is a chart how the "slot-model" of the command processing framework works.
8 <BR>
9 Menu commands and Key accelerators are stored
10 asynchronously into a UNO command stack and later executed
11 sequentially.<BR>
12 </P>
13 <P CLASS="western" STYLE="margin-bottom: 0.5cm"><IMG SRC="sfx2doc0001.svg" NAME="Grafik1" ALIGN=BOTTOM WIDTH=950 HEIGHT=350 BORDER=0></P>
14 <P CLASS="western" STYLE="margin-bottom: 0.5cm"><BR><BR>
16 Changing the system: <b>In Order to add a function to a shell,
17 Add an entry to the .sdi file corresponding to that SfxShell</b><BR>
18 <FONT style="color: red">Example:</FONT>
19 <BR>
20 <PRE><FONT style="background-color: black" color="white">SID_PASTE [ ExecMethod = ExecDrawFunc; StateMethod = GetDrawFuncState; Export = FALSE; ]</FONT></PRE><BR>
21 The "state" method is the method called to checked whether that command is active now. The "exec" method is called when the command should be processed by the shell. Both functions obtain a SfxRequest Object as a parameter, declared in ./include/sfx2/request.hxx.<BR>
22 Each Application Window has ONE Dispatcher.
23 This registers all SfxShells (or rather their
24 subclasses) which can get commands from the user AT THE MOMENT.
25 These shells are created when the edit mode they
26 are part of is first used, but not discarded until the window closes.
27 ./sfx2/source/control/dispatch.cxx:
28 void SfxDispatcher::Pop receives Pushes and Pops
29 of the shell to/from the stack.
30 The real Pushing/Popping, however, is done during
31 SfxDispatcher::FlushImpl
32 Main dispatching routine In
33 ./sfx2/source/control/unoctitm.cxx
34 SfxDispatchController_Impl::dispatch.
35 <BR>
36 SfxDispatchController::_FindServer
37 gets the SfxInterfaces of the shells. They are defined by macro calls
38 to SFX_IMPL_INTERFACE, defined in include/sfx2/shell.hxx .
40 Upon GetInterface, they yield their pInterface,
41 which, upon GetSlot, returns a SfxSlot of that Shell
42 For that command, which is then Executed with
43 Dispatcher::Execute.
44 If the program is set into another mode, for
45 example by clicking a hovering object in writer
46 after Text editing, all shells are removed from
47 the dispatcher and new shells are pushed
48 to match the current mode.
49 <BR>
50 <B> How to build menus</B><BR>
51 In order to introduce a menu command, the uno command must be linked to a slot name.<BR>
52 This is done in different sdi files, such as sfx2/sdi/sfx.sdi.
53 There, you <U>define</U> the slot:<BR>
54 <FONT style="color: red">Structure:</FONT>
56 <PRE>
57 <FONT style="background-color: black" color="white">
58 SfxVoidItem uno_name_the_part_after_colon SID_COMMAND_NAME
59 ()
61 /* initialization of variables is coming here */
63 </PRE>
64 </FONT>
65 In ./include/sfx2/sfxsids.hrc, the defines of the slot names and their numbers are entered. The numbers are just needed because definitions cannot be enums, and for compatibility.<BR>
67 In ./officecfg/registry/data/org/openoffice/Office/UI,
68 there are .xcu ended xml files that define the single menu items.
69 They contain the US- language name and the .uno: command.<BR>
72 <BR><BR>
73 The resource compiler, which creates files some GetState methods refer to, is in the ./rsc directory. It is a separate executable, invoked at compile time.<BR>
75 </P>
76 </BODY>
77 </HTML>