1Zim::GUI(3) User Contributed Perl Documentation Zim::GUI(3)
2
3
4
6 Zim::GUI - The application object for zim
7
9 use Zim::GUI;
10
11 my $zim = Zim::GUI->new(\%SETTINGS);
12 $zim->gui_init;
13 $zim->gui_show;
14
15 Gtk2->main;
16
17 exit;
18
20 This is developer documentation, for the user manual try executing "zim
21 --doc". For commandline options see zim(1).
22
23 This module provides the application object for the Gtk2 application
24 zim. The application has been split into several components for which
25 the modules can be found in the Zim::GUI:: namespace. This object
26 brings together these components and manages the settings and data
27 objects.
28
29 This object inherits from Zim::GUI::Component and Zim::Events.
30
32 Undefined methods are AUTOLOADED either to an component or to the main
33 Gtk2::Window object.
34
35 "new(profile =" NAME, ...)>
36 Simple constructor.
37
38 "gui_init()"
39 This method initializes all GUI objects that make up the applica‐
40 tion.
41
42 "gui_show()"
43 "set_profile(NAME)"
44 Load profile NAME.
45
46 "set_home(PAGE)"
47 Sets the new home page.
48
49 "current()"
50 "plug(PLUGIN)"
51 "unplug(PLUGIN)"
52 "add_object(NAME => OBJECT)"
53 Add a child object to the application object. To access this
54 object later you can use NAME as a method on the application
55 object. By convention object names should be written in CamelCase
56 to avoid conflict with normal methods. Be aware that actions also
57 use CamelCase though.
58
59 OBJECT can either be an object reference, a class name or a code
60 reference. In case of a class reference the object is autoloaded
61 with "CLASS->new(app => $app)", where $app is the main application
62 obejct. In case of a code reference this code is expected to
63 return an object reference when we try to autoload the object.
64
65 "del_object(NAME)"
66 Remove a child object from the application object. Does not neces‐
67 sarily destroy the child object.
68
69 "widget()"
70 Returns the root window widget. Use this widget for things like
71 show_all() and hide_all().
72
73 "load_config"
74 Read config file.
75
76 "save_config"
77 Save config file.
78
79 "link_clicked(LINK)"
80 Loads a page in zim or opens an external url in a browser.
81
82 LINK is considered to be either an page name, an url or a file
83 name. Page names are resolved as relative links first. Dispatches
84 to "open_file()" or "open_url()" when LINK is a file or an url.
85
86 "open_file(FILE)"
87 Opens FILE with the apropriate program. Calls "open_directory()"
88 when FILE is a directory.
89
90 "open_directory(DIR)"
91 Opens DIR in the file browser. Open the parent directory when DIR
92 turns out to be a file.
93
94 "open_url(URL)"
95 Opens URL in the web browser.
96
97 "load_page(PAGE)"
98 Loads a new page, updates history etc. when necessary. PAGE should
99 be either an absolute page name, a history record or a page object.
100
101 use "link_clicked()" for relative page names, urls etc.
102
103 "load_date(DAY, MONTH, YEAR)"
104 Load the zim page coresponding to this date.
105
106 Actions
107
108 The following methods map directly to the ui actions in the menu- and
109 toolbars.
110
111 "NewPage(PAGE)"
112 Open a dialog which allows you to enter a name for a new page.
113 PAGE is used to fill in the namespace in the dialog.
114
115 "OpenNotebook(KEY)"
116 Open another notebook. KEY can either be a directory path or a
117 notebook name. Without KEY the "open notebook" dialog is prompted
118 to the user.
119
120 "Save()"
121 Force saving the current page and state. Returns boolean for suc‐
122 cess.
123
124 "SaveIfModified(SOFT)"
125 Save the page if it was modified. Returns boolean for success or
126 if page was not changed.
127
128 SOFT is an optional argument. If this argument is true the page may
129 not be saved if there is an issue. This is used to skip auto-saving
130 in some cases. Also "soft" changes may not be committed for ver‐
131 sion management etc.
132
133 "SaveCopy()"
134 "Export()"
135 "EmailPage()"
136 Open the current page in the email client.
137
138 "RenamePage(FROM, TO, UPDATE_SELF, UPDATE_OTHER)"
139 Wrapper for "Zim->move_page()".
140
141 Move page from FROM to TO. If TO is undefined a dialog is shown to
142 ask for a page name.
143
144 UPDATE_SELF is a boolean telling to update all links in this page.
145 UPDATE_OTHER is a boolean telling to update all links to this page.
146
147 Without arguments prompts the user for input.
148
149 Returns boolean for success.
150
151 "DeletePage(PAGE, RECURS, NO_CONFIRM)"
152 Wrapper for "Zim->delete_page". Asks the user for confirmation.
153
154 If PAGE is undefined the current page is deleted.
155
156 TODO: make recusive delete work
157
158 "Props()"
159 Show the properties dialog.
160
161 "Close()"
162 Close the application.
163
164 "Quit()"
165 Quit the application.
166
167 "CopyLocation(PAGE, ...)"
168 Copies a list of page names to the clipboard. Without argument
169 uses the current page.
170
171 "Prefs()"
172 Show the preferences dialog.
173
174 "TToolBar(BOOL)"
175 Toggel toolbar visibility. If BOOL is undefined it will just tog‐
176 gle the current state.
177
178 "TStatusBar(BOOL)"
179 Toggle statusbar visibility. If BOOL is undefined it will just
180 toggle the current state.
181
182 "TPane(BOOL)"
183 Toggle visibility of the side pane. If BOOL is undefined it will
184 just toggle the current state. If BOOL is "-1" the pane will be
185 shown, but hidden again as soon as a page is selected.
186
187 "TPathBar(TYPE)"
188 Set the pathbar type to TYPE.
189
190 "TCalendar(BOOL)"
191 Toggle calendar visibility. If BOOL is undefined it will just tog‐
192 gle the current state.
193
194 "Reload()"
195 Save and reload the current page.
196
197 "Search($QUERY)"
198 Open QUERY in the search dialog.
199
200 "SearchBL()"
201 Open backlinks for current page in search dialog.
202
203 "OpenFolder()"
204 Open the dir for the current page.
205
206 "EditSource()"
207 Open the current page in an external editor.
208
209 "RBIndex()"
210 Rebuild the index cache.
211
212 "GoBack($INT)"
213 Go back one or more steps in the history stack.
214
215 "GoForward($INT)"
216 Go forward one or more steps in the history stack.
217
218 "GoParent()"
219 Go to page up in namespace.
220
221 "GoChild()"
222 Go to page down in namespace.
223
224 "GoNext()"
225 Go to the next page in the index.
226
227 "GoPrev()"
228 Go to the previous page in the index.
229
230 "GoToday()"
231 Go to the page for todays date.
232
233 "GoHome()"
234 Go to the home page.
235
236 "JumpTo(PAGE)"
237 Go to PAGE. Shows a dialog when no page is given.
238
239 "ShowHelpKeys()"
240 "ShowHelpBugs()"
241 Shows help on keybindings and bugs. Trying to seduce people to
242 actually read the manual...
243
244 "About()"
245 This dialog tells you about the version of zim you are using.
246
247 Other functions
248
249 Functions below are used by other methods. They are not considered
250 part of the api.
251
252 "update_status()"
253 Sets the statusbar to display the current page name and some other
254 information.
255
256 "push_status(STRING, CONTEXT)"
257 Put STRING in the status bar.
258
259 pop_status(CONTEXT)
260 Removes a string from the status bar.
261
262 "prompt_rename_page_dialog(PAGE)"
263 Runs a dialog that gathers info for moving a page. Returns new
264 page name and update boolean.
265
267 Please mail the author if you find any bugs.
268
270 Jaap Karssenberg (Pardus) <pardus@cpan.org>
271
272 Copyright (c) 2005 Jaap G Karssenberg. All rights reserved. This pro‐
273 gram is free software; you can redistribute it and/or modify it under
274 the same terms as Perl itself.
275
277 zim(1), Zim, Zim::GUI::Component
278
279
280
281perl v5.8.8 2007-12-27 Zim::GUI(3)