262132b76a1efce35f124580e8dbac177fe9fc49
[profile/ivi/qtbase.git] / examples / mainwindows / macmainwindow / macmainwindow.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the demonstration applications of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 #ifndef MACMAINWINDOW_H
42 #define MACMAINWINDOW_H
43
44 #include <QtWidgets>
45
46 #ifdef Q_WS_MAC
47
48 #import <qmaccocoaviewcontainer_mac.h>
49
50 class SearchWidget : public QMacCocoaViewContainer
51 {
52     Q_OBJECT
53 public:
54     SearchWidget(QWidget *parent = 0);
55     ~SearchWidget();
56
57     QSize sizeHint() const;
58 private:
59 };
60
61
62 QMenu *createMenu(QWidget *parent);
63
64 class SearchWrapper : public QWidget
65 {
66 Q_OBJECT
67 public:
68     SearchWrapper(QWidget *parent = 0);
69     QSize sizeHint() const;
70     QWidget *s;
71 };
72
73 class Spacer : public QWidget
74 {
75 Q_OBJECT
76 public:
77     Spacer(QWidget *parent = 0);
78     QSize sizeHint() const;
79 };
80
81 class MacSplitterHandle : public QSplitterHandle
82 {
83 Q_OBJECT
84 public:
85     MacSplitterHandle(Qt::Orientation orientation, QSplitter *parent);
86     void paintEvent(QPaintEvent *);
87     QSize sizeHint() const;
88 };
89
90 class MacSplitter : public QSplitter
91 {
92 public:
93     QSplitterHandle *createHandle();
94 };
95
96 class MacMainWindow : public QMainWindow
97 {
98 Q_OBJECT
99 public:
100     MacMainWindow();
101     ~MacMainWindow();
102     QAbstractItemModel *createItemModel();
103     void resizeEvent(QResizeEvent *e);
104     QAbstractItemModel *createDocumentModel();
105 public:
106     QSplitter *splitter;
107     QSplitter *horizontalSplitter;
108     QTreeView *sidebar;
109     QListView *documents;
110     QTextEdit *textedit;
111     QVBoxLayout *layout;
112     SearchWidget *searchWidget;
113     QToolBar * toolBar;
114 };
115
116 #endif // Q_WS_MAC
117
118 #endif //MACMAINWINDOW_H