author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/kaction.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | microkde/kdeui/kaction.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/microkde/kdeui/kaction.h b/microkde/kdeui/kaction.h index 13e2e1e..5c690ec 100644 --- a/microkde/kdeui/kaction.h +++ b/microkde/kdeui/kaction.h | |||
@@ -16,47 +16,49 @@ | |||
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | Library General Public License for more details. | 17 | Library General Public License for more details. |
18 | 18 | ||
19 | You should have received a copy of the GNU Library General Public License | 19 | You should have received a copy of the GNU Library General Public License |
20 | along with this library; see the file COPYING.LIB. If not, write to | 20 | along with this library; see the file COPYING.LIB. If not, write to |
21 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 21 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
22 | Boston, MA 02111-1307, USA. | 22 | Boston, MA 02111-1307, USA. |
23 | */ | 23 | */ |
24 | //$Id$ | 24 | //$Id$ |
25 | 25 | ||
26 | #ifndef __kaction_h__ | 26 | #ifndef __kaction_h__ |
27 | #define __kaction_h__ | 27 | #define __kaction_h__ |
28 | 28 | ||
29 | 29 | ||
30 | //US #include <qkeysequence.h> | 30 | //US #include <qkeysequence.h> |
31 | #include <qobject.h> | 31 | #include <qobject.h> |
32 | #include <qvaluelist.h> | 32 | #include <q3valuelist.h> |
33 | #include <qguardedptr.h> | 33 | #include <qpointer.h> |
34 | //Added by qt3to4: | ||
35 | #include <Q3PopupMenu> | ||
34 | #include <kguiitem.h> | 36 | #include <kguiitem.h> |
35 | #include <kshortcut.h> | 37 | #include <kshortcut.h> |
36 | #include <kstdaction.h> | 38 | #include <kstdaction.h> |
37 | //US#include <kicontheme.h> | 39 | //US#include <kicontheme.h> |
38 | 40 | ||
39 | //US added the following files | 41 | //US added the following files |
40 | #include <kiconloader.h> | 42 | #include <kiconloader.h> |
41 | 43 | ||
42 | class QMenuBar; | 44 | class QMenuBar; |
43 | class QPopupMenu; | 45 | class Q3PopupMenu; |
44 | //USclass QComboBox; | 46 | //USclass QComboBox; |
45 | //USclass QPoint; | 47 | //USclass QPoint; |
46 | class QIconSet; | 48 | class QIcon; |
47 | class QString; | 49 | class QString; |
48 | class KToolBar; | 50 | class KToolBar; |
49 | 51 | ||
50 | class KAccel; | 52 | class KAccel; |
51 | //USclass KAccelActions; | 53 | //USclass KAccelActions; |
52 | //USclass KConfig; | 54 | //USclass KConfig; |
53 | //USclass KConfigBase; | 55 | //USclass KConfigBase; |
54 | //USclass KURL; | 56 | //USclass KURL; |
55 | //USclass KInstance; | 57 | //USclass KInstance; |
56 | //USclass KToolBar; | 58 | //USclass KToolBar; |
57 | class KActionCollection; | 59 | class KActionCollection; |
58 | //USclass KPopupMenu; | 60 | //USclass KPopupMenu; |
59 | class KMainWindow; | 61 | class KMainWindow; |
60 | 62 | ||
61 | /** | 63 | /** |
62 | * The KAction class (and derived and super classes) provides a way to | 64 | * The KAction class (and derived and super classes) provides a way to |
@@ -246,33 +248,33 @@ public: | |||
246 | * | 248 | * |
247 | * If you do not want or have a keyboard shortcut, set the | 249 | * If you do not want or have a keyboard shortcut, set the |
248 | * @p cut param to 0. | 250 | * @p cut param to 0. |
249 | * | 251 | * |
250 | * This is the other common KAction used. Use it when you | 252 | * This is the other common KAction used. Use it when you |
251 | * @p do have a corresponding icon. | 253 | * @p do have a corresponding icon. |
252 | * | 254 | * |
253 | * @param text The text that will be displayed. | 255 | * @param text The text that will be displayed. |
254 | * @param pix The icon to display. | 256 | * @param pix The icon to display. |
255 | * @param cut The corresponding keyboard shortcut. | 257 | * @param cut The corresponding keyboard shortcut. |
256 | * @param receiver The SLOT's parent. | 258 | * @param receiver The SLOT's parent. |
257 | * @param slot The SLOT to invoke to execute this action. | 259 | * @param slot The SLOT to invoke to execute this action. |
258 | * @param parent This action's parent. | 260 | * @param parent This action's parent. |
259 | * @param name An internal name for this action. | 261 | * @param name An internal name for this action. |
260 | */ | 262 | */ |
261 | 263 | ||
262 | KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 264 | KAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
263 | const QObject* receiver, const char* slot, | 265 | const QObject* receiver, const char* slot, |
264 | KActionCollection* parent, const char* name ); | 266 | KActionCollection* parent, const char* name ); |
265 | 267 | ||
266 | /** | 268 | /** |
267 | * Constructs an action with text, icon, potential keyboard | 269 | * Constructs an action with text, icon, potential keyboard |
268 | * shortcut, and a SLOT to call when this action is invoked by | 270 | * shortcut, and a SLOT to call when this action is invoked by |
269 | * the user. The icon is loaded on demand later based on where it | 271 | * the user. The icon is loaded on demand later based on where it |
270 | * is plugged in. | 272 | * is plugged in. |
271 | * | 273 | * |
272 | * If you do not want or have a keyboard shortcut, set the | 274 | * If you do not want or have a keyboard shortcut, set the |
273 | * @p cut param to 0. | 275 | * @p cut param to 0. |
274 | * | 276 | * |
275 | * This is the other common KAction used. Use it when you | 277 | * This is the other common KAction used. Use it when you |
276 | * @p do have a corresponding icon. | 278 | * @p do have a corresponding icon. |
277 | * | 279 | * |
278 | * @param text The text that will be displayed. | 280 | * @param text The text that will be displayed. |
@@ -295,43 +297,43 @@ public: | |||
295 | */ | 297 | */ |
296 | KAction( const KGuiItem& item, const KShortcut& cut, | 298 | KAction( const KGuiItem& item, const KShortcut& cut, |
297 | const QObject* receiver, const char* slot, | 299 | const QObject* receiver, const char* slot, |
298 | KActionCollection* parent, const char* name ); | 300 | KActionCollection* parent, const char* name ); |
299 | /** | 301 | /** |
300 | * @obsolete | 302 | * @obsolete |
301 | */ | 303 | */ |
302 | KAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); | 304 | KAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 ); |
303 | /** | 305 | /** |
304 | * @obsolete | 306 | * @obsolete |
305 | */ | 307 | */ |
306 | KAction( const QString& text, const KShortcut& cut, | 308 | KAction( const QString& text, const KShortcut& cut, |
307 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); | 309 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); |
308 | /** | 310 | /** |
309 | * @obsolete | 311 | * @obsolete |
310 | */ | 312 | */ |
311 | KAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(), | 313 | KAction( const QString& text, const QIcon& pix, const KShortcut& cut = KShortcut(), |
312 | QObject* parent = 0, const char* name = 0 ); | 314 | QObject* parent = 0, const char* name = 0 ); |
313 | /** | 315 | /** |
314 | * @obsolete | 316 | * @obsolete |
315 | */ | 317 | */ |
316 | KAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), | 318 | KAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(), |
317 | QObject* parent = 0, const char* name = 0 ); | 319 | QObject* parent = 0, const char* name = 0 ); |
318 | /** | 320 | /** |
319 | * @obsolete | 321 | * @obsolete |
320 | */ | 322 | */ |
321 | KAction( const QString& text, const QIconSet& pix, const KShortcut& cut, | 323 | KAction( const QString& text, const QIcon& pix, const KShortcut& cut, |
322 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); | 324 | const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 ); |
323 | /** | 325 | /** |
324 | * @obsolete | 326 | * @obsolete |
325 | */ | 327 | */ |
326 | KAction( const QString& text, const QString& pix, const KShortcut& cut, | 328 | KAction( const QString& text, const QString& pix, const KShortcut& cut, |
327 | const QObject* receiver, const char* slot, QObject* parent, | 329 | const QObject* receiver, const char* slot, QObject* parent, |
328 | const char* name = 0 ); | 330 | const char* name = 0 ); |
329 | /** | 331 | /** |
330 | * @obsolete | 332 | * @obsolete |
331 | */ | 333 | */ |
332 | KAction( QObject* parent = 0, const char* name = 0 ); | 334 | KAction( QObject* parent = 0, const char* name = 0 ); |
333 | 335 | ||
334 | /** | 336 | /** |
335 | * Standard destructor | 337 | * Standard destructor |
336 | */ | 338 | */ |
337 | virtual ~KAction(); | 339 | virtual ~KAction(); |
@@ -448,36 +450,36 @@ public: | |||
448 | virtual QString group() const; | 450 | virtual QString group() const; |
449 | 451 | ||
450 | /** | 452 | /** |
451 | * Get the What's this text for the action. | 453 | * Get the What's this text for the action. |
452 | */ | 454 | */ |
453 | virtual QString whatsThis() const; | 455 | virtual QString whatsThis() const; |
454 | 456 | ||
455 | /** | 457 | /** |
456 | * Get the tooltip text for the action. | 458 | * Get the tooltip text for the action. |
457 | */ | 459 | */ |
458 | virtual QString toolTip() const; | 460 | virtual QString toolTip() const; |
459 | 461 | ||
460 | /** | 462 | /** |
461 | * Get the QIconSet from which the icons used to display this action will | 463 | * Get the QIconSet from which the icons used to display this action will |
462 | * be chosen. | 464 | * be chosen. |
463 | */ | 465 | */ |
464 | virtual QIconSet iconSet( KIcon::Group group, int size=0 ) const; | 466 | virtual QIcon iconSet( KIcon::Group group, int size=0 ) const; |
465 | 467 | ||
466 | #ifndef KDE_NO_COMPAT | 468 | #ifndef KDE_NO_COMPAT |
467 | QIconSet iconSet() const | 469 | QIcon iconSet() const |
468 | { | 470 | { |
469 | return iconSet( KIcon::Small ); | 471 | return iconSet( KIcon::Small ); |
470 | } | 472 | } |
471 | #endif | 473 | #endif |
472 | 474 | ||
473 | virtual QString icon() const; | 475 | virtual QString icon() const; |
474 | 476 | ||
475 | KActionCollection *parentCollection() const; | 477 | KActionCollection *parentCollection() const; |
476 | 478 | ||
477 | /** | 479 | /** |
478 | * @internal | 480 | * @internal |
479 | * Generate a toolbar button id. Made public for reimplementations. | 481 | * Generate a toolbar button id. Made public for reimplementations. |
480 | */ | 482 | */ |
481 | static int getToolButtonID(); | 483 | static int getToolButtonID(); |
482 | 484 | ||
483 | 485 | ||
@@ -505,70 +507,70 @@ public slots: | |||
505 | * The What's this text can include QML markup as well as raw text. | 507 | * The What's this text can include QML markup as well as raw text. |
506 | */ | 508 | */ |
507 | virtual void setWhatsThis( const QString& text ); | 509 | virtual void setWhatsThis( const QString& text ); |
508 | 510 | ||
509 | /** | 511 | /** |
510 | * Sets the tooltip text for the action. | 512 | * Sets the tooltip text for the action. |
511 | * This will be used as a tooltip for a toolbar button, as a | 513 | * This will be used as a tooltip for a toolbar button, as a |
512 | * statusbar help-text for a menu item, and it also appears | 514 | * statusbar help-text for a menu item, and it also appears |
513 | * in the toolbar editor, to describe the action. | 515 | * in the toolbar editor, to describe the action. |
514 | */ | 516 | */ |
515 | virtual void setToolTip( const QString& ); | 517 | virtual void setToolTip( const QString& ); |
516 | 518 | ||
517 | /** | 519 | /** |
518 | * Sets the QIconSet from which the icons used to display this action will | 520 | * Sets the QIconSet from which the icons used to display this action will |
519 | * be chosen. | 521 | * be chosen. |
520 | */ | 522 | */ |
521 | virtual void setIconSet( const QIconSet &iconSet ); | 523 | virtual void setIconSet( const QIcon &iconSet ); |
522 | 524 | ||
523 | virtual void setIcon( const QString& icon ); | 525 | virtual void setIcon( const QString& icon ); |
524 | 526 | ||
525 | /** | 527 | /** |
526 | * Enables or disables this action. All uses of this action (eg. in menus | 528 | * Enables or disables this action. All uses of this action (eg. in menus |
527 | * or toolbars) will be updated to reflect the state of the action. | 529 | * or toolbars) will be updated to reflect the state of the action. |
528 | */ | 530 | */ |
529 | virtual void setEnabled(bool enable); | 531 | virtual void setEnabled(bool enable); |
530 | 532 | ||
531 | /** | 533 | /** |
532 | * Indicate whether the user may configure the action's shortcut. | 534 | * Indicate whether the user may configure the action's shortcut. |
533 | */ | 535 | */ |
534 | virtual void setShortcutConfigurable( bool ); | 536 | virtual void setShortcutConfigurable( bool ); |
535 | 537 | ||
536 | /** | 538 | /** |
537 | * Emulate user's interaction programmatically, by activating the action. | 539 | * Emulate user's interaction programmatically, by activating the action. |
538 | * The implementation simply emits activated(). | 540 | * The implementation simply emits activated(). |
539 | */ | 541 | */ |
540 | virtual void activate(); | 542 | virtual void activate(); |
541 | 543 | ||
542 | protected slots: | 544 | protected slots: |
543 | virtual void slotDestroyed(); | 545 | virtual void slotDestroyed(); |
544 | virtual void slotKeycodeChanged(); | 546 | virtual void slotKeycodeChanged(); |
545 | virtual void slotActivated(); | 547 | virtual void slotActivated(); |
546 | 548 | ||
547 | protected: | 549 | protected: |
548 | KToolBar* toolBar( int index ) const; | 550 | KToolBar* toolBar( int index ) const; |
549 | QPopupMenu* popupMenu( int index ) const; | 551 | Q3PopupMenu* popupMenu( int index ) const; |
550 | void removeContainer( int index ); | 552 | void removeContainer( int index ); |
551 | int findContainer( const QWidget* widget ) const; | 553 | int findContainer( const QWidget* widget ) const; |
552 | void plugMainWindowAccel( QWidget *w ); | 554 | void plugMainWindowAccel( QWidget *w ); |
553 | 555 | ||
554 | void addContainer( QWidget* parent, int id ); | 556 | void addContainer( QWidget* parent, int id ); |
555 | void addContainer( QWidget* parent, QWidget* representative ); | 557 | void addContainer( QWidget* parent, QWidget* representative ); |
556 | 558 | ||
557 | virtual void updateShortcut( int i ); | 559 | virtual void updateShortcut( int i ); |
558 | virtual void updateShortcut( QPopupMenu* menu, int id ); | 560 | virtual void updateShortcut( Q3PopupMenu* menu, int id ); |
559 | virtual void updateGroup( int id ); | 561 | virtual void updateGroup( int id ); |
560 | virtual void updateText(int i ); | 562 | virtual void updateText(int i ); |
561 | virtual void updateEnabled(int i); | 563 | virtual void updateEnabled(int i); |
562 | virtual void updateIconSet(int i); | 564 | virtual void updateIconSet(int i); |
563 | virtual void updateIcon( int i); | 565 | virtual void updateIcon( int i); |
564 | virtual void updateToolTip( int id ); | 566 | virtual void updateToolTip( int id ); |
565 | virtual void updateWhatsThis( int i ); | 567 | virtual void updateWhatsThis( int i ); |
566 | 568 | ||
567 | KActionCollection *m_parentCollection; | 569 | KActionCollection *m_parentCollection; |
568 | QString whatsThisWithIcon() const; | 570 | QString whatsThisWithIcon() const; |
569 | 571 | ||
570 | signals: | 572 | signals: |
571 | void activated(); | 573 | void activated(); |
572 | void enabled( bool ); | 574 | void enabled( bool ); |
573 | 575 | ||
574 | private: | 576 | private: |