~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to libs/kotext/tests/MockTextShape.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  This file is part of KOffice tests
 
3
 *
 
4
 *  Copyright (C) 2006-2010 Thomas Zander <zander@kde.org>
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
19
 */
 
20
 
 
21
#ifndef MOCKTEXTSHAPE_H
 
22
#define MOCKTEXTSHAPE_H
 
23
 
 
24
#include <KoTextShapeData.h>
 
25
#include <KoTextDocumentLayout.h>
 
26
#include <KoShapeContainer.h>
 
27
 
 
28
class MockTextShape : public KoShapeContainer
 
29
{
 
30
public:
 
31
    MockTextShape() {
 
32
        KoTextShapeData *textShapeData = new KoTextShapeData();
 
33
        setUserData(textShapeData);
 
34
        layout = new KoTextDocumentLayout(textShapeData->document());
 
35
        layout->addShape(this);
 
36
        textShapeData->document()->setDocumentLayout(layout);
 
37
    }
 
38
    virtual void paintComponent(QPainter &, const KoViewConverter &) { }
 
39
    virtual void saveOdf(KoShapeSavingContext &) const {}
 
40
    virtual bool loadOdf(const KoXmlElement &, KoShapeLoadingContext &) {
 
41
        return true;
 
42
    }
 
43
    KoTextDocumentLayout *layout;
 
44
};
 
45
 
 
46
#endif