~timo-jyrinki/ubuntu/trusty/maliit-framework/fix_qt52

« back to all changes in this revision

Viewing changes to src/windowedsurface_p.h

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Sergio Schvezov, Ricardo Salveti de Araujo
  • Date: 2013-07-23 19:47:04 UTC
  • mfrom: (1.1.2) (1.2.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130723194704-1lsy1kmlda069cea
Tags: 0.99.0+git20130615+97e8335-0ubuntu1
[ Sergio Schvezov ]
* New build from HEAD 97e8335.
* Packaging import from lp:phablet-extras/maliit-framework.

[ Ricardo Salveti de Araujo ]
* debian/control: adding vcs and fixing dependencies
* General package cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of Maliit framework *
3
 
 *
4
 
 * Copyright (C) 2012 Intel Corporation and/or its subsidiary(-ies).
5
 
 * All rights reserved.
6
 
 *
7
 
 * Contact: maliit-discuss@lists.maliit.org
8
 
 *
9
 
 * This library is free software; you can redistribute it and/or
10
 
 * modify it under the terms of the GNU Lesser General Public
11
 
 * License version 2.1 as published by the Free Software Foundation
12
 
 * and appearing in the file LICENSE.LGPL included in the packaging
13
 
 * of this file.
14
 
 */
15
 
 
16
 
#ifndef MALIIT_SERVER_WINDOWED_SURFACE_P_H
17
 
#define MALIIT_SERVER_WINDOWED_SURFACE_P_H
18
 
 
19
 
#include <QObject>
20
 
#include <QPoint>
21
 
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
22
 
#include <QWindow>
23
 
#else
24
 
#include <QWidget> // For WId
25
 
#endif
26
 
 
27
 
#include <vector>
28
 
 
29
 
#ifdef HAVE_WAYLAND
30
 
#include <wayland-client.h>
31
 
#include "wayland-desktop-shell-client-protocol.h"
32
 
#endif
33
 
 
34
 
#include "maliit/plugins/abstractsurface.h"
35
 
 
36
 
namespace Maliit {
37
 
namespace Server {
38
 
 
39
 
class WindowedSurfaceFactory;
40
 
 
41
 
class WindowedSurface : public QObject,
42
 
                        public virtual Maliit::Plugins::AbstractSurface
43
 
{
44
 
    Q_OBJECT
45
 
 
46
 
public:
47
 
    WindowedSurface(WindowedSurfaceFactory *factory,
48
 
                    AbstractSurface::Options options,
49
 
                    const QSharedPointer<WindowedSurface> &parent,
50
 
                    QWidget *toplevel);
51
 
 
52
 
    ~WindowedSurface();
53
 
 
54
 
    void show();
55
 
    void hide();
56
 
    QSize size() const;
57
 
    void setSize(const QSize &size);
58
 
    QPoint relativePosition() const;
59
 
    void setRelativePosition(const QPoint &position);
60
 
    QSharedPointer<AbstractSurface> parent() const;
61
 
    QPoint translateEventPosition(const QPoint &eventPosition,
62
 
                                  const QSharedPointer<AbstractSurface> &eventSurface = QSharedPointer<AbstractSurface>()) const;
63
 
    void setActive(bool active);
64
 
    void applicationFocusChanged(WId winId);
65
 
    QRegion inputMethodArea();
66
 
    virtual QWidget *widget() const = 0;
67
 
 
68
 
private:
69
 
    void updateVisibility();
70
 
 
71
 
protected:
72
 
    bool isWindow() const;
73
 
    QPoint mapToGlobal(const QPoint &pos) const;
74
 
 
75
 
    bool eventFilter(QObject *object, QEvent *event);
76
 
 
77
 
    WindowedSurfaceFactory *mFactory;
78
 
    Options mOptions;
79
 
    QSharedPointer<WindowedSurface> mParent;
80
 
    QScopedPointer<QWidget> mToplevel;
81
 
    bool mActive;
82
 
    bool mVisible;
83
 
    QPoint mRelativePosition;
84
 
 
85
 
#ifdef HAVE_WAYLAND
86
 
    struct input_panel_surface *mSurface;
87
 
#endif
88
 
};
89
 
 
90
 
} // namespace Server
91
 
} // namespace Maliit
92
 
 
93
 
#endif // MALIIT_SERVER_WINDOWED_SURFACE_P_H