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
|
/***************************************************************************
* Copyright (C) 2003-2005 by liuspider *
* liuspider@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
**************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "socketserverthread.h"
#include "utils/scimxmlguibuilder.h"
#include "utils/scimdragableframe.h"
#include <dcopobject.h>
#include <qlayout.h>
class ScimToolBar;
class ScimMoveHandle;
class SkimPluginManager;
class SkimGlobalActions;
class ScimAction;
class QPopupMenu;
class QLabel;
class MainWindow : public ScimDragableFrame, public ScimXMLGUIClient, public DCOPObject
{
Q_OBJECT
K_DCOP
public:
enum ToolBarModeType {StandAlone=0, PanelEmbedded};
MainWindow( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~MainWindow();
void toggleDocking(bool internel);
ScimMoveHandle* m_moveHandle;
k_dcop:
void changePreferedSize(QSize, int d);
void appletDestroyed(bool);
void toggleDocking();
void reInit();
public slots:
void show();
// void hide();
void adjustSize();
void requestReloadSelf ();
void changeSetting();
void updateProperties (bool);
private:
void createToolbar ();
void resetToolbarSize (QSize newsize = QSize());
SkimPluginManager* m_allModules;
scim::SocketServerThread* m_inputServer;
KXMLGUIFactory* m_guiFactory;
QTimer* m_autoHideTimeoutTimer;
QTimer* m_showHandleTimer;
QTimer* m_showExtHandleTimer;
QSize m_embeddedAreaSize;
ToolBarModeType m_mode;
bool m_embedInitialized;
int m_autoHideTimeout;
bool m_contentIsVisible;
bool m_panelTurnedOn;
bool m_updatePropertiesNeeded;
bool m_alwaysShow;
bool m_autoSnap;
bool m_alwaysShowHandle;
bool m_alwaysShowExtensionHandle;
bool m_updateGUIProperties, m_updateFrontendProperties;
Qt::Orientation m_applet_direction;
QString m_actionListName;
QBoxLayout::Direction m_changeToDirection;
bool m_shouldChangeDirection;
protected:
void enterEvent ( QEvent * );
void leaveEvent ( QEvent * );
void mouseMoveEvent ( QMouseEvent * e );
void startDockingTimer();
void standaloneModeHide();
// void resizeEvent ( QResizeEvent * );
QBoxLayout* m_mainWindowLayout;
// QPoint m_clickPos;
ScimToolBar* m_toolbar;
SkimGlobalActions* m_defaultActionCollection;
ScimAction* m_serverAction;
QPopupMenu* m_contextMenu;
QLabel* m_logo;
class KToggleAction* m_toggleDockingAction;
QPtrList<class KAction> m_insertedActions;
protected slots:
void slotTurnOn();
void slotTurnOff();
void initContextMenu();
void initEmbedPanel();
void showHandleRequest();
void showExtHandleRequest();
void hideHandleRequest();
void slotLeaveEvent();
void hideToolbar();
void settleToolbar();
void contextMenuEvent ( QContextMenuEvent * );
void changeDirection(QBoxLayout::Direction d);
void slotApplicationRegistered (const QCString &);
void disableUpdates();
void enableUpdates();
};
#include "src/skimplugin.h"
class MainWindowPlugin : public SkimPlugin
{
Q_OBJECT
public:
MainWindowPlugin( QObject *parent, const char *name, const QStringList &args );
virtual ~MainWindowPlugin();
public slots:
void toggleDocking();
private:
MainWindow* mainwindow;
class KPanelApplet * applet;
};
#endif // MAINWINDOW_H
|