KIvioPageIface.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 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 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#include "KIvioPageIface.h"
21
22#include "kivio_page.h"
23#include "kivio_layer.h"
24#include <tdeapplication.h>
25#include <dcopclient.h>
26
27KIvioPageIface::KIvioPageIface( KivioPage *page_ )
28 : DCOPObject( page_)
29{
30 m_page = page_;
31}
32
33bool KIvioPageIface::isHidden()const
34{
35 return m_page->isHidden();
36}
37
38void KIvioPageIface::deleteSelectedStencils()
39{
40 m_page->deleteSelectedStencils();
41}
42
43void KIvioPageIface::groupSelectedStencils()
44{
45 m_page->groupSelectedStencils();
46}
47
48void KIvioPageIface::ungroupSelectedStencils()
49{
50 m_page->ungroupSelectedStencils();
51}
52
53
54TQString KIvioPageIface::pageName()const
55{
56 return m_page->pageName();
57}
58
59void KIvioPageIface::copy()
60{
61 m_page->copy();
62}
63
64void KIvioPageIface::cut()
65{
66 m_page->cut();
67}
68
69void KIvioPageIface::paste()
70{
71// m_page->paste();
72}
73
74void KIvioPageIface::selectAllStencils()
75{
76 m_page->selectAllStencils();
77}
78
79void KIvioPageIface::unselectAllStencils()
80{
81 m_page->unselectAllStencils();
82}
83
84
85int KIvioPageIface::nbLayer() const
86{
87 return (int)(m_page->layers())->count();
88}
89
90DCOPRef KIvioPageIface::firstLayer()
91{
92 if ( m_page->firstLayer())
93 return DCOPRef( kapp->dcopClient()->appId(),
94 m_page->firstLayer()->dcopObject()->objId() );
95 else
96 return DCOPRef();
97}
98
99DCOPRef KIvioPageIface::layerAt( int pos)
100{
101 if ( pos >= nbLayer() )
102 return DCOPRef();
103 return DCOPRef( kapp->dcopClient()->appId(),
104 m_page->layerAt(pos)->dcopObject()->objId() );
105}
106
107void KIvioPageIface::setHidePage(bool _hide)
108{
109 m_page->setHidePage(_hide);
110}