~osomon/oxide/im-fake-key-events

« back to all changes in this revision

Viewing changes to qt/core/api/oxideqnavigationrequest.h

  • Committer: Chris Coulson
  • Date: 2014-04-01 10:06:59 UTC
  • mfrom: (438.1.17 window-opening)
  • Revision ID: chris.coulson@canonical.com-20140401100659-48y7z8nqq6fklz0w
MergeĀ fromĀ lp:~chrisccoulson/oxide/window-opening

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vim:expandtab:shiftwidth=2:tabstop=2:
 
2
// Copyright (C) 2014 Canonical Ltd.
 
3
 
 
4
// This library is free software; you can redistribute it and/or
 
5
// modify it under the terms of the GNU Lesser General Public
 
6
// License as published by the Free Software Foundation; either
 
7
// version 2.1 of the License, or (at your option) any later version.
 
8
 
 
9
// This library is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
// Lesser General Public License for more details.
 
13
 
 
14
// You should have received a copy of the GNU Lesser General Public
 
15
// License along with this library; if not, write to the Free Software
 
16
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 
 
18
#ifndef OXIDE_Q_NAVIGATION_REQUEST
 
19
#define OXIDE_Q_NAVIGATION_REQUEST
 
20
 
 
21
#include <QObject>
 
22
#include <QScopedPointer>
 
23
#include <QtGlobal>
 
24
#include <QUrl>
 
25
 
 
26
class OxideQNavigationRequestPrivate;
 
27
 
 
28
class Q_DECL_EXPORT OxideQNavigationRequest Q_DECL_FINAL : public QObject {
 
29
  Q_OBJECT
 
30
 
 
31
  Q_PROPERTY(QUrl url READ url CONSTANT)
 
32
  Q_PROPERTY(Disposition disposition READ disposition CONSTANT)
 
33
  Q_PROPERTY(bool userGesture READ userGesture CONSTANT)
 
34
  Q_PROPERTY(Action action READ action WRITE setAction NOTIFY actionChanged)
 
35
 
 
36
  Q_ENUMS(Disposition)
 
37
  Q_ENUMS(Action)
 
38
 
 
39
  Q_DECLARE_PRIVATE(OxideQNavigationRequest)
 
40
  Q_DISABLE_COPY(OxideQNavigationRequest)
 
41
 
 
42
 public:
 
43
 
 
44
  enum Disposition {
 
45
    DispositionCurrentTab,
 
46
    DispositionNewForegroundTab,
 
47
    DispositionNewBackgroundTab,
 
48
    DispositionNewPopup,
 
49
    DispositionNewWindow
 
50
  };
 
51
 
 
52
  enum Action {
 
53
    ActionAccept,
 
54
    ActionReject = 0xFF
 
55
  };
 
56
 
 
57
  ~OxideQNavigationRequest();
 
58
  Q_DECL_HIDDEN OxideQNavigationRequest(const QUrl& url,
 
59
                                        Disposition disposition,
 
60
                                        bool user_gesture);
 
61
 
 
62
  QUrl url() const;
 
63
  Disposition disposition() const;
 
64
  bool userGesture() const;
 
65
 
 
66
  Action action() const;
 
67
  void setAction(Action action);
 
68
 
 
69
 Q_SIGNALS:
 
70
  void actionChanged();
 
71
 
 
72
 private:
 
73
  QScopedPointer<OxideQNavigationRequestPrivate> d_ptr;
 
74
};
 
75
 
 
76
#endif // OXIDE_Q_NAVIGATION_REQUEST