~ubuntu-branches/ubuntu/oneiric/kig/oneiric

« back to all changes in this revision

Viewing changes to objects/text_type.h

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter
  • Date: 2011-07-10 11:57:38 UTC
  • Revision ID: james.westby@ubuntu.com-20110710115738-gdjnn1kctr49lmy9
Tags: upstream-4.6.90+repack
ImportĀ upstreamĀ versionĀ 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C)  2003  Dominique Devriese <devriese@kde.org>
 
2
 
 
3
// This program is free software; you can redistribute it and/or
 
4
// modify it under the terms of the GNU General Public License
 
5
// as published by the Free Software Foundation; either version 2
 
6
// of the License, or (at your option) any later version.
 
7
 
 
8
// This program is distributed in the hope that it will be useful,
 
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
// GNU General Public License for more details.
 
12
 
 
13
// You should have received a copy of the GNU General Public License
 
14
// along with this program; if not, write to the Free Software
 
15
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
16
// 02110-1301, USA.
 
17
 
 
18
#ifndef KIG_OBJECTS_TEXT_TYPE_H
 
19
#define KIG_OBJECTS_TEXT_TYPE_H
 
20
 
 
21
#include "object_type.h"
 
22
 
 
23
class GenericTextType
 
24
  : public ObjectType
 
25
{
 
26
  const ArgsParser mparser;
 
27
protected:
 
28
  GenericTextType( const char* fulltypename );
 
29
  ~GenericTextType();
 
30
public:
 
31
  const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
 
32
  bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
 
33
  const ObjectImpType* resultId() const;
 
34
 
 
35
  ObjectImp* calc( const Args& parents, const KigDocument& d ) const;
 
36
 
 
37
  std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& os ) const;
 
38
  Args sortArgs( const Args& args ) const;
 
39
 
 
40
  bool canMove( const ObjectTypeCalcer& ourobj ) const;
 
41
  bool isFreelyTranslatable( const ObjectTypeCalcer& ourobj ) const;
 
42
  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
 
43
  const Coordinate moveReferencePoint( const ObjectTypeCalcer& ourobj ) const;
 
44
  void move( ObjectTypeCalcer& ourobj, const Coordinate& to,
 
45
             const KigDocument& ) const;
 
46
 
 
47
  QStringList specialActions() const;
 
48
  void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& c,
 
49
                      KigPart& d, KigWidget& w, NormalMode& m ) const;
 
50
 
 
51
  const ArgsParser& argParser() const;
 
52
};
 
53
 
 
54
class TextType
 
55
  : public GenericTextType
 
56
{
 
57
  TextType();
 
58
  ~TextType();
 
59
public:
 
60
  static const TextType* instance();
 
61
 
 
62
  QStringList specialActions() const;
 
63
  void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& c,
 
64
                      KigPart& d, KigWidget& w, NormalMode& m ) const;
 
65
};
 
66
 
 
67
class NumericTextType
 
68
  : public GenericTextType
 
69
{
 
70
  NumericTextType();
 
71
  ~NumericTextType();
 
72
public:
 
73
  static const NumericTextType* instance();
 
74
 
 
75
  QStringList specialActions() const;
 
76
  void executeAction( int i, ObjectHolder& o, ObjectTypeCalcer& c,
 
77
                      KigPart& d, KigWidget& w, NormalMode& m ) const;
 
78
};
 
79
#endif