SIP4 python bindings for TQt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

qlayout.sip 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. // This is the SIP interface definition for TQBoxLayout, TQGLayoutIterator,
  2. // TQGridLayout, TQHBoxLayout, TQLayout, TQLayoutItem, TQLayoutIterator,
  3. // TQSpacerItem, TQVBoxLayout and TQWidgetItem.
  4. //
  5. // Copyright (c) 2007
  6. // Riverbank Computing Limited <info@riverbankcomputing.co.uk>
  7. //
  8. // This file is part of PyTQt.
  9. //
  10. // This copy of PyTQt is free software; you can redistribute it and/or modify it
  11. // under the terms of the GNU General Public License as published by the Free
  12. // Software Foundation; either version 2, or (at your option) any later
  13. // version.
  14. //
  15. // PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
  16. // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  17. // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  18. // details.
  19. //
  20. // You should have received a copy of the GNU General Public License along with
  21. // PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
  22. // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  23. %ExportedDoc
  24. <Sect2><Title>TQLayout</Title>
  25. <Para>
  26. <Literal>TQLayout</Literal> is fully implemented.
  27. </Para>
  28. </Sect2>
  29. <Sect2><Title>TQBoxLayout</Title>
  30. <Para>
  31. <Literal>TQBoxLayout</Literal> is fully implemented.
  32. </Para>
  33. </Sect2>
  34. <Sect2><Title>TQGLayoutIterator (TQt v2+)</Title>
  35. <Para>
  36. <Literal>TQGLayoutIterator</Literal> is fully implemented.
  37. </Para>
  38. </Sect2>
  39. <Sect2><Title>TQGridLayout</Title>
  40. <FuncSynopsis>
  41. <FuncDef>bool <Function>findWidget</Function></FuncDef>
  42. <ParamDef>TQWidget *<Parameter>w</Parameter></ParamDef>
  43. <ParamDef>int *<Parameter>row</Parameter></ParamDef>
  44. <ParamDef>int *<Parameter>col</Parameter></ParamDef>
  45. </FuncSynopsis>
  46. <Para>
  47. This takes the <Literal>w</Literal> parameter and returns a tuple containing
  48. the <Literal>bool</Literal> result, <Literal>row</Literal> and
  49. <Literal>col</Literal>. (TQt v2+)
  50. </Para>
  51. </Sect2>
  52. <Sect2><Title>TQHBoxLayout</Title>
  53. <Para>
  54. <Literal>TQHBoxLayout</Literal> is fully implemented.
  55. </Para>
  56. </Sect2>
  57. <Sect2><Title>TQLayoutItem (TQt v2+)</Title>
  58. <Para>
  59. <Literal>TQLayoutItem</Literal> is fully implemented.
  60. </Para>
  61. </Sect2>
  62. <Sect2><Title>TQLayoutIterator (TQt v2+)</Title>
  63. <FuncSynopsis>
  64. <FuncDef>TQLayoutItem *<Function>next</Function></FuncDef>
  65. <ParamDef></ParamDef>
  66. </FuncSynopsis>
  67. <Para>
  68. This is a wrapper around the <Literal>TQLayoutIterator</Literal>
  69. <Literal>++</Literal> operator.
  70. </Para>
  71. </Sect2>
  72. <Sect2><Title>TQSpacerItem (TQt v2+)</Title>
  73. <Para>
  74. <Literal>TQSpacerItem</Literal> is fully implemented.
  75. </Para>
  76. </Sect2>
  77. <Sect2><Title>TQVBoxLayout</Title>
  78. <Para>
  79. <Literal>TQVBoxLayout</Literal> is fully implemented.
  80. </Para>
  81. </Sect2>
  82. <Sect2><Title>TQWidgetItem (TQt v2+)</Title>
  83. <Para>
  84. <Literal>TQWidgetItem</Literal> is fully implemented.
  85. </Para>
  86. </Sect2>
  87. %End
  88. %If (- TQt_2_00)
  89. class TQLayout : TQObject
  90. {
  91. %TypeHeaderCode
  92. #include <qlayout.h>
  93. %End
  94. public:
  95. enum
  96. {
  97. unlimited = TQCOORD_MAX
  98. };
  99. int defaultBorder() const;
  100. virtual bool activate();
  101. void freeze(int,int);
  102. void freeze();
  103. void setMenuBar(TQMenuBar *);
  104. TQWidget *mainWidget();
  105. protected:
  106. TQLayout(TQWidget * /TransferThis/,int,int,const char *);
  107. TQLayout(int = -1,const char * = 0);
  108. TQGManager *basicManager();
  109. virtual TQChain *mainVerticalChain() = 0;
  110. virtual TQChain *mainHorizontalChain() = 0;
  111. virtual void initGM() = 0;
  112. void addChildLayout(TQLayout *);
  113. private:
  114. TQLayout(const TQLayout &);
  115. };
  116. %End
  117. %If (TQt_2_00 -)
  118. class TQGLayoutIterator
  119. {
  120. %TypeHeaderCode
  121. #include <qabstractlayout.h>
  122. %End
  123. public:
  124. virtual TQLayoutItem *next() = 0;
  125. virtual TQLayoutItem *current() = 0;
  126. virtual TQLayoutItem *takeCurrent() = 0 /TransferBack/;
  127. };
  128. class TQLayoutIterator
  129. {
  130. %TypeHeaderCode
  131. #include <qabstractlayout.h>
  132. %End
  133. public:
  134. TQLayoutIterator(TQGLayoutIterator *) /Default/;
  135. TQLayoutIterator(const TQLayoutIterator &);
  136. TQLayoutItem *next();
  137. %MethodCode
  138. Py_BEGIN_ALLOW_THREADS
  139. sipRes = ++(*sipCpp);
  140. Py_END_ALLOW_THREADS
  141. %End
  142. TQLayoutItem *current();
  143. TQLayoutItem *takeCurrent() /TransferBack/;
  144. void deleteCurrent();
  145. };
  146. class TQLayoutItem
  147. {
  148. %TypeHeaderCode
  149. #include <qabstractlayout.h>
  150. %End
  151. public:
  152. TQLayoutItem(int = 0 );
  153. %ConvertToSubClassCode
  154. // Note that we let the TQObject sub-class code handle TQLayout and it's
  155. // sub-classes.
  156. if (sipCpp->widget())
  157. sipClass = sipClass_TQWidgetItem;
  158. else if (sipCpp->spacerItem())
  159. sipClass = sipClass_TQSpacerItem;
  160. else
  161. sipClass = NULL;
  162. %End
  163. virtual TQSize sizeHint() const = 0;
  164. virtual TQSize minimumSize() const = 0;
  165. virtual TQSize maximumSize() const = 0;
  166. virtual TQSizePolicy::ExpandData expanding() const = 0;
  167. virtual void setGeometry(const TQRect &) = 0;
  168. virtual TQRect geometry() const = 0;
  169. virtual bool isEmpty() const = 0;
  170. virtual bool hasHeightForWidth() const;
  171. virtual int heightForWidth(int) const;
  172. virtual void invalidate();
  173. virtual TQWidget *widget();
  174. virtual TQLayoutIterator iterator();
  175. virtual TQLayout *layout();
  176. virtual TQSpacerItem *spacerItem();
  177. int alignment() const;
  178. virtual void setAlignment(int);
  179. };
  180. class TQSpacerItem : TQLayoutItem
  181. {
  182. %TypeHeaderCode
  183. #include <qabstractlayout.h>
  184. %End
  185. public:
  186. TQSpacerItem(int,int,TQSizePolicy::SizeType = TQSizePolicy::Minimum,
  187. TQSizePolicy::SizeType = TQSizePolicy::Minimum);
  188. void changeSize(int,int,TQSizePolicy::SizeType = TQSizePolicy::Minimum,
  189. TQSizePolicy::SizeType = TQSizePolicy::Minimum);
  190. TQSize sizeHint() const;
  191. TQSize minimumSize() const;
  192. TQSize maximumSize() const;
  193. TQSizePolicy::ExpandData expanding() const;
  194. bool isEmpty() const;
  195. void setGeometry(const TQRect &);
  196. TQRect geometry() const;
  197. TQSpacerItem *spacerItem();
  198. };
  199. class TQWidgetItem : TQLayoutItem
  200. {
  201. %TypeHeaderCode
  202. #include <qabstractlayout.h>
  203. %End
  204. public:
  205. TQWidgetItem(TQWidget *);
  206. TQSize sizeHint() const;
  207. TQSize minimumSize() const;
  208. TQSize maximumSize() const;
  209. TQSizePolicy::ExpandData expanding() const;
  210. bool isEmpty() const;
  211. void setGeometry(const TQRect &) ;
  212. TQRect geometry() const;
  213. virtual TQWidget *widget();
  214. bool hasHeightForWidth() const;
  215. int heightForWidth(int) const;
  216. };
  217. class TQLayout : TQObject, TQLayoutItem
  218. {
  219. %TypeHeaderCode
  220. #include <qabstractlayout.h>
  221. %End
  222. public:
  223. enum ResizeMode {
  224. FreeResize,
  225. Minimum,
  226. Fixed,
  227. %If (TQt_3_1_0 -)
  228. Auto
  229. %End
  230. };
  231. TQLayout(TQWidget * /TransferThis/,int = 0,int = -1,const char * = 0);
  232. TQLayout(TQLayout * /TransferThis/,int = -1,const char * = 0);
  233. TQLayout(int = -1,const char * = 0);
  234. int margin() const;
  235. int spacing() const;
  236. virtual void setMargin(int);
  237. virtual void setSpacing(int);
  238. %If (- TQt_3_1_0)
  239. enum {
  240. unlimited
  241. };
  242. %End
  243. %If (TQt_3_0_0 -)
  244. int defaultBorder() const;
  245. void freeze(int,int);
  246. void freeze();
  247. %End
  248. void setResizeMode(ResizeMode);
  249. ResizeMode resizeMode() const;
  250. virtual void setMenuBar(TQMenuBar *);
  251. TQMenuBar *menuBar() const;
  252. TQWidget *mainWidget();
  253. bool isTopLevel() const;
  254. virtual void setAutoAdd(bool);
  255. bool autoAdd() const;
  256. %If (TQt_2_1_0 -)
  257. void invalidate();
  258. %End
  259. TQRect geometry() const;
  260. bool activate();
  261. void add(TQWidget *);
  262. virtual void addItem(TQLayoutItem * /Transfer/) = 0;
  263. %If (TQt_3_1_0 -)
  264. void remove(TQWidget *);
  265. void removeItem(TQLayoutItem * /TransferBack/);
  266. %End
  267. TQSizePolicy::ExpandData expanding() const;
  268. TQSize minimumSize() const;
  269. TQSize maximumSize() const;
  270. void setGeometry(const TQRect &) = 0;
  271. TQLayoutIterator iterator() = 0;
  272. bool isEmpty() const;
  273. int totalHeightForWidth(int) const;
  274. TQSize totalMinimumSize() const;
  275. TQSize totalMaximumSize() const;
  276. TQSize totalSizeHint() const;
  277. TQLayout *layout();
  278. %If (TQt_2_1_0 -)
  279. bool supportsMargin() const;
  280. %End
  281. %If (TQt_2_2_0 -)
  282. void setEnabled(bool);
  283. bool isEnabled() const;
  284. %End
  285. protected:
  286. bool eventFilter(TQObject *,TQEvent *);
  287. %If (TQt_3_0_0 -)
  288. void childEvent(TQChildEvent *);
  289. %End
  290. void addChildLayout(TQLayout *);
  291. void deleteAllItems();
  292. %If (TQt_2_1_0 -)
  293. void setSupportsMargin(bool);
  294. TQRect alignmentRect(const TQRect &) const;
  295. %End
  296. private:
  297. TQLayout(const TQLayout &);
  298. };
  299. %End
  300. class TQGridLayout : TQLayout
  301. {
  302. %TypeHeaderCode
  303. #include <qlayout.h>
  304. %End
  305. public:
  306. %If (- TQt_2_1_0)
  307. TQGridLayout(TQWidget * /TransferThis/,int,int,int = 0,int = -1,const char * = 0);
  308. TQGridLayout(int,int,int = -1,const char * = 0);
  309. %End
  310. %If (TQt_2_00 - TQt_2_1_0)
  311. TQGridLayout(TQLayout * /TransferThis/,int,int,int = -1,const char * = 0);
  312. %End
  313. %If (TQt_2_1_0 -)
  314. TQGridLayout(TQWidget * /TransferThis/,int = 1,int = 1,int = 0,int = -1,const char * = 0);
  315. TQGridLayout(int = 1,int = 1,int = -1,const char * = 0);
  316. TQGridLayout(TQLayout * /TransferThis/,int = 1,int = 1,int = -1,const char * = 0);
  317. %End
  318. %If (TQt_2_00 -)
  319. TQSize sizeHint() const;
  320. TQSize minimumSize() const;
  321. TQSize maximumSize() const;
  322. %End
  323. %If (- TQt_2_00)
  324. void setRowStretch(int,int);
  325. void setColStretch(int,int);
  326. %End
  327. %If (TQt_2_00 -)
  328. virtual void setRowStretch(int,int);
  329. virtual void setColStretch(int,int);
  330. %End
  331. %If (TQt_2_1_0 -)
  332. int rowStretch(int) const;
  333. int colStretch(int) const;
  334. %End
  335. %If (TQt_3_2_0 -)
  336. void setRowSpacing(int,int);
  337. void setColSpacing(int,int);
  338. int rowSpacing(int) const;
  339. int colSpacing(int) const;
  340. %End
  341. int numRows() const;
  342. int numCols() const;
  343. %If (TQt_2_1_0 -)
  344. TQRect cellGeometry(int,int) const;
  345. %End
  346. %If (TQt_2_00 -)
  347. bool hasHeightForWidth() const;
  348. int heightForWidth(int) const;
  349. %If (TQt_3_1_0 -)
  350. int minimumHeightForWidth(int) const;
  351. %End
  352. TQSizePolicy::ExpandData expanding() const;
  353. void invalidate();
  354. void addItem(TQLayoutItem * /Transfer/);
  355. %End
  356. %If (TQt_2_1_0 -)
  357. void addItem(TQLayoutItem * /Transfer/,int,int);
  358. %End
  359. %If (TQt_2_00 -)
  360. void addMultiCell(TQLayoutItem * /Transfer/,int,int,int,int,int = 0);
  361. %End
  362. void addWidget(TQWidget *,int,int,int = 0);
  363. void addMultiCellWidget(TQWidget *,int,int,int,int,int = 0);
  364. void addLayout(TQLayout * /Transfer/,int,int);
  365. %If (TQt_2_2_0 -)
  366. void addMultiCellLayout(TQLayout * /Transfer/,int,int,int,int,int = 0);
  367. %End
  368. void addRowSpacing(int,int);
  369. void addColSpacing(int,int);
  370. void expand(int,int);
  371. %If (TQt_2_00 -)
  372. enum Corner {
  373. TopLeft,
  374. TopRight,
  375. BottomLeft,
  376. BottomRight
  377. };
  378. void setOrigin(Corner);
  379. %End
  380. %If (TQt_3_0_0 -)
  381. Corner origin() const;
  382. %End
  383. %If (TQt_2_00 -)
  384. TQLayoutIterator iterator();
  385. void setGeometry(const TQRect &);
  386. %End
  387. protected:
  388. %If (- TQt_2_00)
  389. TQChain *mainVerticalChain();
  390. TQChain *mainHorizontalChain();
  391. void initGM();
  392. %End
  393. %If (TQt_2_00 -)
  394. bool findWidget(TQWidget *,int *,int *);
  395. void add(TQLayoutItem * /Transfer/,int,int);
  396. %End
  397. private:
  398. TQGridLayout(const TQGridLayout &);
  399. };
  400. class TQBoxLayout : TQLayout
  401. {
  402. %TypeHeaderCode
  403. #include <qlayout.h>
  404. %End
  405. public:
  406. enum Direction {
  407. LeftToRight,
  408. RightToLeft,
  409. TopToBottom,
  410. BottomToTop,
  411. Down = TopToBottom,
  412. Up = BottomToTop
  413. };
  414. TQBoxLayout(TQWidget * /TransferThis/,Direction,int = 0,int = -1,const char * = 0);
  415. %If (TQt_2_00 -)
  416. TQBoxLayout(TQLayout * /TransferThis/,Direction,int = -1,const char * = 0);
  417. %End
  418. TQBoxLayout(Direction,int = -1,const char * = 0);
  419. Direction direction() const;
  420. %If (TQt_2_1_0 -)
  421. void setDirection(Direction);
  422. %End
  423. void addSpacing(int);
  424. void addStretch(int = 0);
  425. %If (- TQt_2_00)
  426. void addWidget(TQWidget *,int = 0,int = AlignCenter);
  427. %End
  428. void addLayout(TQLayout * /Transfer/,int = 0);
  429. void addStrut(int);
  430. %If (TQt_2_00 -)
  431. void addItem(TQLayoutItem * /Transfer/);
  432. void addWidget(TQWidget *,int = 0,int = 0);
  433. %If (TQt_2_1_0 -)
  434. void insertSpacing(int,int);
  435. void insertStretch(int,int = 0);
  436. void insertWidget(int,TQWidget *,int = 0,int = 0);
  437. void insertLayout(int,TQLayout * /Transfer/,int = 0);
  438. int findWidget(TQWidget *);
  439. %End
  440. bool setStretchFactor(TQWidget *,int);
  441. TQSize sizeHint() const;
  442. TQSize minimumSize() const;
  443. TQSize maximumSize() const;
  444. bool hasHeightForWidth() const;
  445. int heightForWidth(int) const;
  446. %If (TQt_3_1_0 -)
  447. int minimumHeightForWidth(int) const;
  448. %End
  449. TQSizePolicy::ExpandData expanding() const;
  450. void invalidate();
  451. TQLayoutIterator iterator();
  452. void setGeometry(const TQRect &);
  453. %End
  454. protected:
  455. %If (- TQt_2_00)
  456. TQChain *mainVerticalChain();
  457. TQChain *mainHorizontalChain();
  458. void initGM();
  459. %End
  460. %If (TQt_2_1_0 -)
  461. void insertItem(int,TQLayoutItem * /Transfer/);
  462. %End
  463. private:
  464. TQBoxLayout(const TQBoxLayout &);
  465. };
  466. class TQHBoxLayout : TQBoxLayout
  467. {
  468. %TypeHeaderCode
  469. #include <qlayout.h>
  470. %End
  471. public:
  472. TQHBoxLayout(TQWidget * /TransferThis/,int = 0,int = -1,const char * = 0);
  473. %If (TQt_2_00 -)
  474. TQHBoxLayout(TQLayout * /TransferThis/,int = -1,const char * = 0);
  475. %End
  476. TQHBoxLayout(int = -1,const char * = 0);
  477. private:
  478. %If (TQt_3_1_0 -)
  479. TQHBoxLayout(const TQHBoxLayout &);
  480. %End
  481. };
  482. class TQVBoxLayout : TQBoxLayout
  483. {
  484. %TypeHeaderCode
  485. #include <qlayout.h>
  486. %End
  487. public:
  488. TQVBoxLayout(TQWidget * /TransferThis/,int = 0,int = -1,const char * = 0);
  489. %If (TQt_2_00 -)
  490. TQVBoxLayout(TQLayout * /TransferThis/,int = -1,const char * = 0);
  491. %End
  492. TQVBoxLayout(int = -1,const char * = 0);
  493. private:
  494. %If (TQt_3_1_0 -)
  495. TQVBoxLayout(const TQVBoxLayout &);
  496. %End
  497. };