~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to lib/kscript/kscript_ext_qhboxlayout.cc

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// We want to access the signals
2
 
#include <qobjectdefs.h>
3
 
#ifdef signals
4
 
#undef signals
5
 
#define signals public
6
 
#endif
7
 
 
8
 
#include "kscript_ext_qhboxlayout.h"
9
 
#include "kscript_context.h"
10
 
#include "kscript_util.h"
11
 
 
12
 
#include <qlayout.h>
13
 
 
14
 
#undef OBJECT
15
 
#define OBJECT ((QHBoxLayout*)object())
16
 
#undef CHECKTYPE
17
 
#define CHECKTYPE( context, v, type ) if ( !checkType( context, v, type ) ) return FALSE;
18
 
#define RETURN_LEFTEXPR( n, value ) if ( name == n ) { KSValue::Ptr ptr = value; ptr->setMode( KSValue::LeftExpr ); return ptr; }
19
 
#define RETURN_RIGHTEXPR( n, value ) if ( name == n ) { return value; }
20
 
#define CHECK_LEFTEXPR( context, name ) if ( context.leftExpr() ) return KSObject::member( context, name );
21
 
#define SET_PROP( __n, __expr, __t ) if ( name == __n ) { CHECKTYPE( context, v, __t ); __expr; return TRUE; }
22
 
 
23
 
KSClass_QHBoxLayout::KSClass_QHBoxLayout( KSModule* m, const char* name ) : KSClass_QBoxLayout( m, name )
24
 
{
25
 
  nameSpace()->insert( "QHBoxLayout", new KSValue( (KSBuiltinMethod)&KSObject_QHBoxLayout::ksQHBoxLayout ) );
26
 
}
27
 
 
28
 
KSScriptObject* KSClass_QHBoxLayout::createObject( KSClass* c )
29
 
{
30
 
  return new KSObject_QHBoxLayout( c );
31
 
}
32
 
 
33
 
// ------------------------------------------------------
34
 
 
35
 
KSObject_QHBoxLayout::KSObject_QHBoxLayout( KSClass* c ) : KSObject_QBoxLayout( c )
36
 
{
37
 
}
38
 
 
39
 
bool KSObject_QHBoxLayout::ksQHBoxLayout( KSContext& context )
40
 
{
41
 
  qDebug("QHBoxLayout\n");
42
 
 
43
 
  if ( !checkDoubleConstructor( context, "QHBoxLayout" ) )
44
 
    return false;
45
 
 
46
 
  QValueList<KSValue::Ptr>& args = context.value()->listValue();
47
 
 
48
 
  QWidget* parent = 0;
49
 
  QString name;
50
 
 
51
 
  if ( args.count() >= 1 )
52
 
  {
53
 
      if ( !checkArguments( context, context.value(), "QHBoxLayout::QHBoxLayout", KS_Qt_Object::WidgetType ) )
54
 
          return FALSE;
55
 
      parent = KSObject_QWidget::convert( args[0] );
56
 
  }
57
 
  if ( args.count() >= 2 )
58
 
  {
59
 
      if ( !checkArguments( context, context.value(), "QHBoxLayout::QHBoxLayout", KS_Qt_Object::StringType ) )
60
 
          return FALSE;
61
 
      name = args[1]->stringValue();
62
 
  }
63
 
  if ( args.count() > 2 )
64
 
  {
65
 
      KSUtil::tooFewArgumentsError( context, "QHBoxLayout::QHBoxLayout" );
66
 
      return FALSE;
67
 
  }
68
 
 
69
 
  setObject( new QHBoxLayout( parent, 6, 6, name.latin1() ) );
70
 
 
71
 
  return true;
72
 
}
73
 
 
74
 
KSValue::Ptr KSObject_QHBoxLayout::member( KSContext& context, const QString& name )
75
 
{
76
 
  CHECK_LEFTEXPR( context, name );
77
 
 
78
 
  return KS_Qt_Object::member( context, name );
79
 
}
80
 
 
81
 
bool KSObject_QHBoxLayout::setMember( KSContext& context, const QString& name, const KSValue::Ptr& v )
82
 
{
83
 
  return KS_Qt_Object::setMember( context, name, v );
84
 
}