~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kwin/scripting/s_clientgroup.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/********************************************************************
 
2
 KWin - the KDE window manager
 
3
 This file is part of the KDE project.
 
4
 
 
5
Copyright (C) 2010 Rohan Prabhu <rohan@rohanprabhu.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; either version 2 of the License, or
 
10
(at your option) any later version.
 
11
 
 
12
This program is distributed in the hope that it will be useful,
 
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
GNU General Public License for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
*********************************************************************/
 
20
 
 
21
#ifndef KWIN_SCRIPTING_S_CLIENTGROUP_H
 
22
#define KWIN_SCRIPTING_S_CLIENTGROUP_H
 
23
 
 
24
#include <QDebug>
 
25
#include <QScriptEngine>
 
26
#include "./../client.h"
 
27
#include "./../clientgroup.h"
 
28
 
 
29
namespace SWrapper
 
30
{
 
31
 
 
32
class ClientGroup : public QObject
 
33
{
 
34
    Q_OBJECT
 
35
 
 
36
private:
 
37
    KWin::ClientGroup* centralObject;
 
38
    bool invalid;
 
39
 
 
40
public:
 
41
    ClientGroup(KWin::ClientGroup*);
 
42
    ClientGroup(KWin::Client*);
 
43
 
 
44
    KWin::ClientGroup* getCentralObject();
 
45
 
 
46
    /**
 
47
      * A lot of functions for the KWin::ClientGroup* object.
 
48
      * Mostly self-explanatory, works exactly like their C++
 
49
      * analogues.
 
50
      */
 
51
    static QScriptValue add(QScriptContext*, QScriptEngine*);
 
52
    static QScriptValue remove(QScriptContext*, QScriptEngine*);
 
53
    static QScriptValue clients(QScriptContext*, QScriptEngine*);
 
54
    static QScriptValue setVisible(QScriptContext*, QScriptEngine*);
 
55
    static QScriptValue contains(QScriptContext*, QScriptEngine*);
 
56
    static QScriptValue indexOf(QScriptContext*, QScriptEngine*);
 
57
 
 
58
    /** This is one weird function. It can be called like:
 
59
      * move(client, client) OR move(client, index) OR move(index, client)
 
60
      * move(index, index)
 
61
      * NOTE: other than move(client, client), all other calls are mapped to
 
62
      * move(index, index) using indexof(client)
 
63
      */
 
64
    static QScriptValue move(QScriptContext*, QScriptEngine*);
 
65
    static QScriptValue removeAll(QScriptContext*, QScriptEngine*);
 
66
    static QScriptValue closeAll(QScriptContext*, QScriptEngine*);
 
67
    static QScriptValue minSize(QScriptContext*, QScriptEngine*);
 
68
    static QScriptValue maxSize(QScriptContext*, QScriptEngine*);
 
69
    static QScriptValue visible(QScriptContext*, QScriptEngine*);
 
70
 
 
71
    static QScriptValue construct(QScriptContext*, QScriptEngine*);
 
72
    static QScriptValue generate(QScriptEngine*, SWrapper::ClientGroup*);
 
73
    static QScriptValue publishClientGroupClass(QScriptEngine*);
 
74
};
 
75
 
 
76
}
 
77
#endif