~feng-kylin/youker-assistant/youker-assistant

« back to all changes in this revision

Viewing changes to mainui/mainwindow.h

  • Committer: kobe
  • Date: 2015-02-13 07:37:10 UTC
  • Revision ID: xiangli@ubuntukylin.com-20150213073710-0jyp02ilyi5njj10
Qt Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd.
 
3
 *
 
4
 * Authors:
 
5
 *  Kobe Lee    xiangli@ubuntukylin.com/kobe24_lixiang@126.com
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; version 3.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifndef MAINWINDOW_H
 
21
#define MAINWINDOW_H
 
22
 
 
23
#include <QMainWindow>
 
24
#include <QPixmap>
 
25
#include <QTranslator>
 
26
#include <QSettings>
 
27
 
 
28
#include "titlewidget.h"
 
29
#include "actionwidget.h"
 
30
#include "toolwidget.h"
 
31
#include "loginwidget.h"
 
32
#include "contentwidget.h"
 
33
#include "homepage.h"
 
34
#include "infowidget.h"
 
35
#include "settingwidget.h"
 
36
#include "cleanerwidget.h"
 
37
#include "boxwidget.h"
 
38
#include "skincenter.h"
 
39
#include "../component/kylinmenu.h"
 
40
#include "../component/utils.h"
 
41
#include "../component/systemtray.h"
 
42
 
 
43
#include "homeactionwidget.h"
 
44
#include "infoactionwidget.h"
 
45
#include "cleaneractionwidget.h"
 
46
#include "settingactionwidget.h"
 
47
#include "boxactionwidget.h"
 
48
#include "aboutdialog.h"
 
49
 
 
50
//#include "../dbusproxy/youkersystemdbus.h"
 
51
 
 
52
class SessionDispatcher;
 
53
class SystemDispatcher;
 
54
 
 
55
namespace Ui {
 
56
class MainWindow;
 
57
}
 
58
 
 
59
class MainWindow : public QMainWindow
 
60
{
 
61
    Q_OBJECT
 
62
 
 
63
public:
 
64
    explicit MainWindow(QWidget *parent = 0);
 
65
    ~MainWindow();
 
66
    void setTranslator(QTranslator* translator);
 
67
    void setMainWindowLayout();
 
68
    void display();
 
69
    void initConnect();
 
70
    void initSkinCenter();
 
71
    void showHomePage();
 
72
    void showInfoWidget();
 
73
    void showClearWidget();
 
74
    void showSettingWidget();
 
75
 
 
76
//    QPixmap* NinePatch(QString picName,int titleHeight,int BorderLineWidth ,QWidget* Wnd);
 
77
 
 
78
    void reViewThePointSkin(QString pciture);
 
79
    void changeSkin(QString pciture);
 
80
    void restoreSkin();
 
81
 
 
82
protected:
 
83
//    void paintEvent(QPaintEvent *event);
 
84
//    QPixmap background;
 
85
    void mousePressEvent(QMouseEvent *event);
 
86
    void mouseReleaseEvent(QMouseEvent *event);
 
87
    void mouseMoveEvent(QMouseEvent *event);
 
88
 
 
89
public slots:
 
90
    void showBoxWidget();
 
91
    void openSkinCenter();
 
92
    void showMainMenu();
 
93
    void closeYoukerAssistant();
 
94
    void setCurrentPageIndex(int index);
 
95
    void changeLanguage(LANGUAGE language);
 
96
    void newFeatures();
 
97
    void setupConfigure();
 
98
    void aboutUs();
 
99
 
 
100
    void showMainWindow();
 
101
    void iconIsActived(QSystemTrayIcon::ActivationReason reason);
 
102
 
 
103
    void startDbusDaemon();
 
104
 
 
105
signals:
 
106
    void chanegBoxToolStatus();
 
107
 
 
108
private:
 
109
    Ui::MainWindow *ui;
 
110
//    int titleHeight;
 
111
//    QVBoxLayout *main_layout;
 
112
    QBoxLayout *main_layout;
 
113
    QGridLayout *top_grid_layout;
 
114
    QGridLayout *bottom_grid_layout;
 
115
//    QSplitter *splitter;
 
116
    TitleWidget *title_widget;
 
117
    ActionWidget *action_widget;
 
118
    ToolWidget *tool_widget;
 
119
    LoginWidget *login_widget;
 
120
    ContentWidget *content_widget;
 
121
    HomePage *home_page;
 
122
    InfoWidget *info_widget;
 
123
    CleanerWidget *cleaner_widget;
 
124
    SettingWidget *setting_widget;
 
125
    BoxWidget *box_widget;
 
126
 
 
127
    HomeActionWidget *home_action_widget;
 
128
    InfoActionWidget *info_action_widget;
 
129
    CleanerActionWidget *cleaner_action_widget;
 
130
    SettingActionWidget *setting_action_widget;
 
131
    BoxActionWidget *box_action_widget;
 
132
 
 
133
    SkinCenter skin_center;
 
134
    KylinMenu *main_menu;
 
135
 
 
136
    QPoint drag_pos; //移动的距离
 
137
    bool mouse_press; //按下鼠标左键
 
138
 
 
139
    QTranslator* translator; //翻译器
 
140
    LANGUAGE current_language; //当前语言
 
141
 
 
142
    QPixmap main_skin_pixmap;
 
143
    QString last_skin_path;
 
144
    QPixmap review_skin_pixmap;
 
145
 
 
146
    SystemTray *system_tray;
 
147
    SystemDispatcher *systeminterface;
 
148
    SessionDispatcher *sessioninterface;
 
149
    AboutDialog *aboutDlg;
 
150
    QSettings * mSettings;
 
151
};
 
152
 
 
153
#endif // MAINWINDOW_H