GlobalOptions.hh 15.7 KB
Newer Older
Jan Möbius's avatar
 
Jan Möbius committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//=============================================================================
//
//                               OpenFlipper
//        Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
//                           www.openflipper.org
//
//-----------------------------------------------------------------------------
//
//                                License
//
//  OpenFlipper is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  OpenFlipper is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public License
//  along with OpenFlipper.  If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
//   $Revision$
//   $Author$
//   $Date$
//
//=============================================================================




//=============================================================================
//
//  Options used throughout the System
//
//=============================================================================

/**
\file GlobalOptions.hh
 * This Header provides access to globally defined variables such as
 * Aplication Directories. You may use these Functions inside your plugins.
*/

#ifndef OPTIONS_HH
#define OPTIONS_HH

Jan Möbius's avatar
Jan Möbius committed
50
#ifndef DLLEXPORT
Jan Möbius's avatar
 
Jan Möbius committed
51
52
53
54
55
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT
#endif
56
#endif
Jan Möbius's avatar
 
Jan Möbius committed
57
58
59

#include <QDir>
#include <QStringList>
60
#include <QColor>
Jan Möbius's avatar
 
Jan Möbius committed
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

namespace OpenFlipper {
namespace Options {

/// Returns the base Path of the application
DLLEXPORT
QDir applicationDir();

/// Returns the Path to the Standard Plugins
DLLEXPORT
QDir pluginDir();

/// Returns the Path to the Textures
DLLEXPORT
QDir textureDir();

77
78
79
80
/// Returns the Path to the shaders
DLLEXPORT
QDir shaderDir();

Jan Möbius's avatar
 
Jan Möbius committed
81
82
83
84
/// Returns the Path to the Icons
DLLEXPORT
QDir iconDir();

Jan Möbius's avatar
Jan Möbius committed
85
86
87
88
/// Returns the Path to Fonts
DLLEXPORT
QDir fontsDir();

Jan Möbius's avatar
 
Jan Möbius committed
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/// Returns the base Path of the application
DLLEXPORT
QString applicationDirStr();

/// Returns the Path to the Standard Plugins
DLLEXPORT
QString pluginDirStr();

/// Returns the Path to the Shader directory
DLLEXPORT
QString shaderDirStr();

/// Returns the Path to the Textures
DLLEXPORT
QString textureDirStr();

/// Returns the Path to the Icons
DLLEXPORT
QString iconDirStr();

Jan Möbius's avatar
Jan Möbius committed
109
110
111
112
/// Returns the Path to Fonts
DLLEXPORT
QString fontsDirStr();

Jan Möbius's avatar
 
Jan Möbius committed
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/// Sets the base Path of the application
DLLEXPORT
void applicationDir(QDir _dir);

/// Sets the Path to the Plugins
DLLEXPORT
void pluginDir(QDir _dir);

/// Sets the Path to the shaders
DLLEXPORT
void shaderDir(QDir _dir);

/// Sets the Path to the Textures
DLLEXPORT
void textureDir(QDir _dir);

/// Sets the Path to the Icons
DLLEXPORT
void iconDir(QDir _dir);

Jan Möbius's avatar
Jan Möbius committed
133
134
135
136
/// Sets the Path to the Fonts
DLLEXPORT
void fontsDir(QDir _dir);

Jan Möbius's avatar
 
Jan Möbius committed
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/// Sets the base Path of the application
DLLEXPORT
bool applicationDir(QString _dir);

/// Sets the Path to the Plugins
DLLEXPORT
bool pluginDir(QString _dir);

/// Sets the Path to the shaders
DLLEXPORT
bool shaderDir(QString _dir);

/// Sets the Path to the Textures
DLLEXPORT
bool textureDir(QString _dir);

/// Sets the Path to the Icons
DLLEXPORT
bool iconDir(QString _dir);

Jan Möbius's avatar
Jan Möbius committed
157
158
159
160
/// Sets the Path to the Fonts
DLLEXPORT
void fontsDir(QDir _dir);

Jan Möbius's avatar
 
Jan Möbius committed
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213

//===========================================================================
/** @name Option files / paths
* @{ */
//===========================================================================

  /// Set the list of option files
  DLLEXPORT
  void optionFiles(QStringList _list);

  /// returns a list of all available option files
  DLLEXPORT
  QStringList optionFiles();

  /// Sets the Path to the configuration directory
  DLLEXPORT
  void configDir(QDir _dir);

  /// Sets the Path to the configuration directory
  DLLEXPORT
  bool configDir(QString _dir);

  /// Returns the base Path of the config Dir
  DLLEXPORT
  QString configDirStr();

  /// Returns the base Path of the config Dir
  DLLEXPORT
  QDir configDir();

/** @} */

//===========================================================================
/** @name current status
* @{ */
//===========================================================================

  /// return the current directory
  DLLEXPORT
  QString currentDirStr();

  /// return the current directory
  DLLEXPORT
  QDir currentDir();

  /// Sets the Path to the current directory
  DLLEXPORT
  void currentDir(QDir _dir);

  /// Sets the Path to the current directory
  DLLEXPORT
  bool currentDir(QString _dir);

Dirk Wilden's avatar
Dirk Wilden committed
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
  /// return the current script-directory
  DLLEXPORT
  QString currentScriptDirStr();

  /// return the current Script-directory
  DLLEXPORT
  QDir currentScriptDir();

  /// Sets the Path to the current Script-directory
  DLLEXPORT
  void currentScriptDir(QDir _dir);

  /// Sets the Path to the current Script-directory
  DLLEXPORT
  bool currentScriptDir(QString _dir);

Jan Möbius's avatar
 
Jan Möbius committed
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
  /// return last used dataType
  DLLEXPORT
  QString lastDataType();

  /// set the last used dataType
  DLLEXPORT
  void lastDataType(QString _type);

/** @} */

//===========================================================================
/** @name Architecture detection and Architecture specific stuff
* @{ */
//===========================================================================

  DLLEXPORT
  bool is64bit();

  DLLEXPORT
  bool is32bit();

  DLLEXPORT
  bool isLinux();

  DLLEXPORT
  bool isWindows();

  /// Returns the right separator String for this architecture ( Linux: "/" Windows: "\" )
  DLLEXPORT
  QString dirSeparator();

/** @} */

//===========================================================================
/** @name Environment
* @{ */
//===========================================================================

  /// Returns the LANG environment variable string
  DLLEXPORT
  QString lang();

/** @} */

//===========================================================================
/** @name Experience level  of user
* @{ */
//===========================================================================
  enum Experience {
    NOVICE,
    ADVANCED,
    EXPERT
  };

  /// Get experience level
  DLLEXPORT
  Experience getExperience();

  /// Set experience level
  DLLEXPORT
  void setExperience( Experience _exp );

/** @} */

//===========================================================================
/** @name Visualization Control
* @{ */
//===========================================================================

  /// Store if a gui should be visible or not
  DLLEXPORT
  void nogui( bool _nogui );

  /// get if a gui should be visible or not
  DLLEXPORT
  bool nogui( );

  /// get if a gui should be visible or not
  DLLEXPORT
  bool gui( );

  /// Store stereo mode setting
  DLLEXPORT
  void stereo( bool _stereo );

  /// get current stereo setting
  DLLEXPORT
  bool stereo( );

Dirk Wilden's avatar
   
Dirk Wilden committed
319
320
321
322
323
324
325
326
  /// Store synchronization setting
  DLLEXPORT
  void synchronization( bool _synchronization );

  /// get current synchronization setting
  DLLEXPORT
  bool synchronization( );

Jan Möbius's avatar
 
Jan Möbius committed
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
  /// Store animation mode setting
  DLLEXPORT
  void animation( bool _animation );

  /// get current animation setting
  DLLEXPORT
  bool animation( );

  /// Store backfaceCulling setting
  DLLEXPORT
  void backfaceCulling( bool _backfaceCulling );

  /// get backface Culling setting
  DLLEXPORT
  bool backfaceCulling( );

Dirk Wilden's avatar
   
Dirk Wilden committed
343
344
345
346
347
348
349
350
  /// Store twoSidedLighting setting
  DLLEXPORT
  void twoSidedLighting( bool _twoSidedLighting );

  /// get twoSidedLighting setting
  DLLEXPORT
  bool twoSidedLighting( );

Dirk Wilden's avatar
Dirk Wilden committed
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
  /// Store wheelZoomFactor setting
  DLLEXPORT
  void wheelZoomFactor( double _factor );

  /// get wheelZoomFactor setting
  DLLEXPORT
  double wheelZoomFactor( );

  /// Store wheelZoomFactorShift setting
  DLLEXPORT
  void wheelZoomFactorShift( double _factor );

  /// get wheelZoomFactorShift setting
  DLLEXPORT
  double wheelZoomFactorShift( );

367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
  /// Store restrictFrameRate setting
  DLLEXPORT
  void restrictFrameRate( bool _enable );

  /// get restrictFrameRate setting
  DLLEXPORT
  bool restrictFrameRate( );

  /// Store maxFrameRate setting
  DLLEXPORT
  void maxFrameRate( int _fps );

  /// get maxFrameRate setting
  DLLEXPORT
  int maxFrameRate( );

383
384
385
386
387
388
389
390
  /// Store standardDrawMode setting
  DLLEXPORT
  void standardDrawMode( uint _mode );

  /// get standardDrawMode setting
  DLLEXPORT
  uint standardDrawMode( );

Dirk Wilden's avatar
Dirk Wilden committed
391
392
393
394
395
396
397
398
  /// Store disableRedraw setting
  DLLEXPORT
  void redrawDisabled( bool disable );

  /// get disableRedraw setting
  DLLEXPORT
  bool redrawDisabled( );

399
400
401
402
403
404
405
406
  /// Get the flag if a drawMode Menu should always be visible in the context menu
  DLLEXPORT
  bool drawModesInContextMenu();

  /// Set the flag if a drawMode Menu should always be visible in the context menu
  DLLEXPORT
  void drawModesInContextMenu(bool _show);

Jan Möbius's avatar
 
Jan Möbius committed
407
408
409
410
411
412
413
/** @} */

//===========================================================================
/** @name GUI Control
* @{ */
//===========================================================================

414
415
416
417
418
419
420
421
422
423
424
425
  /// Use multiview Mode?
  DLLEXPORT
  void multiView( bool _multiView);

  /// Use multiview Mode?
  DLLEXPORT
  bool multiView();

  /// Number of examiner widgets
  DLLEXPORT
  unsigned int examinerWidgets();

Jan Möbius's avatar
 
Jan Möbius committed
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
  /// Set if we start the logging widget closed
  DLLEXPORT
  void hideLogger( bool _hide);

  /// Start the logging widget closed?
  DLLEXPORT
  bool hideLogger( );

  /// Set if we start the toolbox widget closed
  DLLEXPORT
  void hideToolbox( bool _hide);

  /// Start the toolbox widget closed?
  DLLEXPORT
  bool hideToolbox( );

  /// Start fullscreen Mode?
  DLLEXPORT
  void fullScreen( bool _fs );

  /// Start fullscreen Mode?
  DLLEXPORT
  bool fullScreen( );

  /// Which mode should be the default for the toolbar?
  DLLEXPORT
  QString defaultToolboxMode( );

  /// Which mode should be the default for the toolbar?
  DLLEXPORT
  void defaultToolboxMode( QString _mode );

  /// Titel of the main window
  DLLEXPORT
  QString windowTitle( );

  /// Set title of the main window
  DLLEXPORT
  void windowTitle( QString _titel );

  /// Display splash screen?
  DLLEXPORT
  void splash( bool _splash );

  /// Display splash screen?
  DLLEXPORT
  bool splash( );

474
475
476
477
478
479
480
481
  /// Default background color
  DLLEXPORT
  void defaultBackgroundColor( QRgb _color );

  /// Default background color
  DLLEXPORT
  QRgb defaultBackgroundColor();

Jan Möbius's avatar
 
Jan Möbius committed
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
/** @} */

//===========================================================================
/** @name Scripting Options
 * @{ */
//===========================================================================

  /** Scripting status. If this flag is set to true,
   * you should not call functions for multiple objects. Or do
   * remote procedure calls to functions which add scripting commands.
   * As this might call functions twice when executed via scripts. See the
   * scripting plugin for additional information
   */
  DLLEXPORT
  bool scripting( );

  /** Toggle scripting status (normally done by the Scripting plugin only)
   */
  DLLEXPORT
  void scripting(bool _status );

  /** @} */

//===========================================================================
/** @name Logging Options
 * @{ */
//===========================================================================

  /// Log to console output?
  DLLEXPORT
  bool logToConsole( );

  /// Log to console output?
  DLLEXPORT
  void logToConsole(bool _logToConsole );

  /// Give extra debug information
  DLLEXPORT
  bool debug();

  /// Give extra debug information
  DLLEXPORT
  void debug(bool _debug );

Dirk Wilden's avatar
Dirk Wilden committed
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
  /// enable logging to file
  DLLEXPORT
  void logFileEnabled(bool _enable );

  /// is logging to file enabled?
  DLLEXPORT
  bool logFileEnabled();

  /// logfile location (path + filename)
  DLLEXPORT
  void logFile(QString _filename);

  /// logfile location (path + filename)
  DLLEXPORT
  QString logFile();

Jan Möbius's avatar
 
Jan Möbius committed
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
/** @} */

//===========================================================================
/** @name Backup operations
* @{ */
//===========================================================================

  /// Do backups?
  DLLEXPORT
  bool backupEnabled( );

  /// Do backups?
  DLLEXPORT
  void enableBackup(bool _enableBackup );


/** @} */

//===========================================================================
561
/** @name Settings
Jan Möbius's avatar
 
Jan Möbius committed
562
563
564
* @{ */
//===========================================================================

565
  /// currently loading Settings ?
Jan Möbius's avatar
 
Jan Möbius committed
566
  DLLEXPORT
567
  bool loadingSettings( );
Jan Möbius's avatar
 
Jan Möbius committed
568

569
  /// currently loading Settings ?
Jan Möbius's avatar
 
Jan Möbius committed
570
  DLLEXPORT
571
  void loadingSettings(bool _loadingSettings );
Jan Möbius's avatar
 
Jan Möbius committed
572

573
574
575
576
577
578
579
  /// currently saving Settings ?
  DLLEXPORT
  bool savingSettings( );

  /// currently saving Settings ?
  DLLEXPORT
  void savingSettings(bool _savingSettings );
Jan Möbius's avatar
 
Jan Möbius committed
580

Dirk Wilden's avatar
Dirk Wilden committed
581
582
583
584
585
586
587
588
  /// currently loading recent file ?
  DLLEXPORT
  bool loadingRecentFile( );

  /// currently loading recent file ?
  DLLEXPORT
  void loadingRecentFile(bool _loadingRecentFile );

Jan Möbius's avatar
 
Jan Möbius committed
589
590
/** @} */

591
592
593
//===========================================================================
/** @name Core parameters
* @{ */
Jan Möbius's avatar
Jan Möbius committed
594
//===========================================================================
595
596
597

/// Get the argc parameter from the main application
DLLEXPORT
Jan Möbius's avatar
Jan Möbius committed
598
int* argc();
599
600
601

/// Get the argv parameter from the main application
DLLEXPORT
Jan Möbius's avatar
Jan Möbius committed
602
char *** argv();
603
604
605

/// Set the argc parameter from the main application ( Dont use it, only called from Core!!)
DLLEXPORT
Jan Möbius's avatar
Jan Möbius committed
606
void  argc( int* _argc );
607
608
609

/// Set the argv parameter from the main application ( Dont use it, only called from Core!!)
DLLEXPORT
Jan Möbius's avatar
Jan Möbius committed
610
void argv( char*** _argv);
611

Jan Möbius's avatar
Jan Möbius committed
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629


//===========================================================================
/** @name Debugging Options
 * @{ */
//===========================================================================

/** If you enable slot debugging, for some slots will be displayed who called them.
 * Currently supported slots are:\n
 * - updateView()
 * - updated_objects( objectId )
 */
DLLEXPORT
void doSlotDebugging( bool _debugging );

DLLEXPORT
bool doSlotDebugging( );

630
/** @} */
Jan Möbius's avatar
 
Jan Möbius committed
631

632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
//===========================================================================
/** @name Update Options
 * @{ */
//===========================================================================

/** Set Server URL to check for updates
 */
DLLEXPORT
void updateUrl( QString _url );

/** Get Server URL to check for updates
 */
DLLEXPORT
QString updateUrl( );

/** Set Username for updates
 */
DLLEXPORT
void updateUsername( QString _username );

/** Get Username for updates
 */
DLLEXPORT
QString updateUsername( );

/** Set Password for updates
 */
DLLEXPORT
void updatePassword( QString _password );

/** Get Password for updates
 */
DLLEXPORT
QString updatePassword( );


/** @} */

//===========================================================================
/** @name Version information
 * @{ */
//===========================================================================

/// Version of OpenFlipper Core
DLLEXPORT
QString coreVersion();

679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
/** @} */

//===========================================================================
/** @name Picking Debugger
 * @{ */
//===========================================================================

/** Set rendering Mode for Picking Debugger
 */
DLLEXPORT
void pickingRenderMode( QString _target );

/** Get rendering Mode for Picking Debugger
 */
DLLEXPORT
QString pickingRenderMode( );

/** Enable/Disable Picking Debugger
 */
DLLEXPORT
void renderPicking(bool _enable);

/** Get Picking Debugger state
 */
DLLEXPORT
bool renderPicking( );

706
/** @} */
Jan Möbius's avatar
 
Jan Möbius committed
707
708
709
710
711
712
}
}

//=============================================================================
#endif // OPTIONS_HH defined
//=============================================================================