This file is indexed.

/usr/include/BALL/VIEW/KERNEL/message.h is in libballview1.4-dev 1.4.3~beta1-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
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
474
475
476
477
478
479
480
481
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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
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
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
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//

#ifndef BALL_VIEW_KERNEL_MESSAGE_H
#define BALL_VIEW_KERNEL_MESSAGE_H

#ifndef BALL_VIEW_KERNEL_STAGE_H
#	include <BALL/VIEW/KERNEL/stage.h>
#endif

#ifndef BALL_VIEW_KERNEL_COMMON_H
# include <BALL/VIEW/KERNEL/common.h>
#endif

#include <boost/any.hpp>

class QWidget;

namespace BALL
{
	class Composite;
	class ConformationSet;

	namespace VIEW
	{
		class Dataset;
		class ConnectionObject;
		class GeometricObject;

/** @addtogroup ViewKernelConnectivityMessages */
//@{

/** General Message class.
		Message is the base class of all message classes and provides a base interface.
		Message classes will be sent through the ConnectionObject tree for
		the purpose of communication between several ConnectionObject classes.
		Each ConnectionObject handels in its <b>onNotify()</b> method messages
		that are relevant for that class by means of RTTI. 
		This class can be given a sender object that is a pointer to the 
		ConnectionObject that has initially sent the message. This methods
		concerning the sender object are internally used and no user interaction
		is necessary. A message can be deletable or not. If a message is deletable
		it will be deleted after all ConnectionObject objects has been informed
		of this message. Therefore a deletable message must be created with the <b> new</b>
		command.
		All messages should be created with the <b> new</b> command, since they will be
		automatically deleted after all ConnectionObjects have been notified.
		See ConnectionObject for further information concerning message handling.
		and message posting. \par
*/
class BALL_VIEW_EXPORT Message
{
	public:

	/**	@name	Constructors and Destructor
	*/	
	//@{

	/** Default Constructor.
			The state of this message is:
				-  sender    - set to 0
				-  deletable - set to <tt> false</tt> 
	*/
	Message();

	/** Copy constructor.
	*/
	Message(const Message& message);

	/** Destructor.
	*/
	virtual ~Message();

	//@}
	/**	@name	Accessors: inspectors and mutators 
	*/
	//@{

	/** Change the sender.
			This method will be used internally
			by ConnectionObject::notify_.
			\see         ConnectionObject::notify_
	*/
	void setSender(const ConnectionObject* sender);

	/** Non-mutable inspection of the sender.
			This method will be used internally
			by ConnectionObject::onNotify.
			\see         ConnectionObject::onNotify
	*/
	const ConnectionObject* getSender() const;

	/** Change the deletable flag.
			If the parameter <b> flag</b> is set to <tt> true</tt> the message is set to deletable
			and will be automatically deleted after all ConnectionObject objects
			are notified of this message. It is important that the message
			is created by the <b> new</b> command to avoid segmentation faults.\par
			If the parameter <b> flag</b> is set to <tt> false</tt> the message will not be 
			automatically deleted.\par
			Avoid creating non-deletable messages because it can result in
			segmentation faults.
			\param       flag the new deletable state of this message
	*/
	void setDeletable(bool flag = true);

	/** Test if this message is deletable.
	*/
	bool isDeletable() const;

	/** Access the optional data stored in this message.
	 *  The data is stored as a boost::any to allow any kind of data sets.
	 *  @returns a mutable reference to the data
	 */
	boost::any& data() { return data_; }
	//@}

	private:

	const ConnectionObject* connection_object_;

	bool deletable_;

	boost::any data_;
};


/** Message to notify about changes in a Dataset.
 		This message can be e.g. used to notify all ModularWidget about a new 
		DockResult, Trajectory or any other kind of dataset. The Dataset contains the
		information on the kind of data it contains. The receiving widget thus has to
		query the type of the message and the the type of the Dataset.
		@see Dataset
		@see DatasetController
		@see DatasetControl
*/
class DatasetMessage
	: public Message
{
	public:

		/// Message type enumeration
		enum Type
		{
			/// Default Value
			UNDEFINED = -1,

			/// To add 
			ADD = 0,

			/// To be removed 
			REMOVE,

			/// Update 
			UPDATE,

			/// Was selected in Control
			SELECTED,

			///
			VISUALIZE,

			/// Allow >90 different kinds of visualization
			VISUALIZE_END = 100
		};

		///
		DatasetMessage(Dataset* set = 0, Type type = UNDEFINED);

		///
		DatasetMessage(const DatasetMessage& msg);

		///
		Type getType() const { return type_;}

		///
		void setType(Type type) { type_ = type;}

		///
		Dataset* getDataset() const { return dataset_;}

		///
		void setDataset(Dataset* set) { dataset_ = set;}

		///
		bool isValid() const;

		protected:

		Dataset* dataset_;
		Type 		 type_;
		String 	 dataset_type_;
};

				

/** CompositeMessage is the base class of all messages concerning the change of one Composite.
		With it ConnectionObject can notify and react to Composite changes.
*/
class BALL_VIEW_EXPORT CompositeMessage
	: public Message
{
	public:

	///
	enum CompositeMessageType
	{
		/// Undefinded (default) type
		UNDEFINED = -1,

		/** A new composite to be added 
		 		MolecularStructure will add bonds, normalize names and send a msg with type NEW_MOLECULE afterwards.
		*/
		NEW_COMPOSITE,
		
		/// A Composite to be removed
		REMOVED_COMPOSITE,
		
		/// Update all datas for a Composite (but not in the MolecularControl)
		CHANGED_COMPOSITE,
		
		/// Update all datas for a composite (also in MolecularControl)
		CHANGED_COMPOSITE_HIERARCHY,
		
		/// selected a composite (e.g. per checkboxes in MolecularControl)
		SELECTED_COMPOSITE,
		
		/// deselected a composite (e.g. per checkboxes in MolecularControl)
		DESELECTED_COMPOSITE,
		
		/// center the camera on a composite
		CENTER_CAMERA,

		/** MolecularControl will add the Composite.
		 * 	DisplayProperties will create a Representation
		*/
		NEW_MOLECULE
	};

	/**	@name	Constructors and Destructors
	*/	
	//@{

	/** Default Constructor.
			The state is set to:
				-  composite       - set to 0
				-  composite name  - set to "" 
	*/
	CompositeMessage();

	///
	CompositeMessage(const Composite& composite, CompositeMessageType type, bool update_representations = true);

	/// Copy constructor.
	CompositeMessage(const CompositeMessage& message);

	/// Destructor.
	virtual ~CompositeMessage();

	//@}
	/**	@name	Accessors: inspectors and mutators 
	*/
	//@{
	
	/** Change the composite.
	*/
	void setComposite(const Composite& composite);

	/** Inspection of the composite.
	*/
	Composite* getComposite() const;

	/** Change the name of the composite.
			\param       name the new name of the composite of this compositeMessage
	*/
	void setCompositeName(const String& name);

	/** Inspection of the name of the composite.
	*/
	const String& getCompositeName() const;

	///
	void setType(CompositeMessageType type)
		 { type_ = type;}

	///
	CompositeMessageType getType() const
		 { return type_;}

	///
	void setUpdateRepresentations(bool state)
		 { update_representations_ = state;}

	///
	bool updateRepresentations() const
		 { return update_representations_;}

	///
	void setShowSelectionInfos(bool state)
		 { show_selection_infos_ = state;}

	///
	bool showSelectionInfos()
		 { return show_selection_infos_;}

	//@}

	protected:

	CompositeMessageType 	type_;
	Composite* 						composite_;
	String 								composite_name_;
	bool 									update_representations_;
	bool 									show_selection_infos_;
};


/** SceneMessage is the message class that is responsible for
		changing the content of the Scene.
		ConnectionObject objects that would like to have the Scene focus on another
		Composite or would like to update the contents of the Scene
		(because of some changes in the composite structure) will sent this message.
		There are methods available that will tell the Scene to update its contents
		or change the camera positions.\par
		Send by MainControl, GeometricControl and several dialogs. \par
		Received by Scene
*/
class BALL_VIEW_EXPORT SceneMessage: public Message
{
	public:

	/**	@name	Enumeration
	*/	
	//@{
	
	/// Types for SceneMessages
	enum SceneMessageType
	{
		///
		UNDEFINED = 0,

		/// Rebuild the GLDisplayList objects in the GLRenderer
		REBUILD_DISPLAY_LISTS,
		
		/// Redraw from the GLDisplayList objects
		REDRAW,

		/// Move the Camera in the Scene to the value in this message
		UPDATE_CAMERA,
		
		/// Remove the coordinate system in the Scene.
		REMOVE_COORDINATE_SYSTEM,

		/// Export a PNG
		EXPORT_PNG,

		/// Export a POVRay
		EXPORT_POVRAY,

		/// 
		ENTER_ROTATE_MODE,

		/// 
		ENTER_PICKING_MODE,

		/// Move Composites or a Clipping Plane
		ENTER_MOVE_MODE,

		/// A previous export has finished
		EXPORT_FINISHED
	};

	//@}
	/**	@name	Constructors and Destructors
	*/	
	//@{

	/** Default Constructor.
			The state of this sceneMessage is set to:
				-  type - UNDEFINED
				-  camera - set to defaults
			\par
	*/
	SceneMessage(SceneMessageType type = UNDEFINED);

	/** Copy constructor.
	*/
	SceneMessage(const SceneMessage& message);

	/** Destructor.
	*/
	virtual ~SceneMessage();

	//@}
	/**	@name	Accessors: inspectors and mutators 
	*/
	//@{
	
	/// Set the type of the Message
	void setType(SceneMessageType type);

	/// Get the type of the message
	SceneMessageType getType() const
		 { return type_;}

	/** Set the Stage in this message.
	*/
	void setStage(Stage stage) 
		 { stage_ = stage;}
	
	/// Get the Stage in this message.
	Stage& getStage() 
		 { return stage_;}

	/// Get the Stage in this message.
	const Stage& getStage() const
		 { return stage_;}

	//@}

	private:

	SceneMessageType  type_;
	Stage             stage_;
};


/** GenericSelectionMessage class.
		GenericSelectionMessage is a container for Composite objects that are somehow selected.
		It will be sent by existing ConnectionObject objects that collect
		Composites objects for a certain purpose.
*/
class BALL_VIEW_EXPORT GenericSelectionMessage: public Message
{
	public:

	/**	@name	Constructors and Destructors
	*/
	//@{

	/** Default Constructor.
			The state is set to:
				-  composite list - empty
	*/
	GenericSelectionMessage();

	/** Copy constructor.
	*/
	GenericSelectionMessage(const GenericSelectionMessage& message);

	/** Destructor.
	*/
	virtual ~GenericSelectionMessage();

	//@}
	/**	@name	Accessors: inspectors and mutators 
	*/
	//@{

	/** Change the selection of Composite objects.
			The selection list will be copied from the given list.
	*/
	void setSelection(const std::list<Composite*>& selection);

	/** Non-mutable inspection of the selection of Composite objects.
	*/
	const std::list<Composite*>& getSelection() const;

	/** mutable inspection of the selection of Composite objects.
	*/
	std::list<Composite*>& getSelection();

	//@}

	private:

	std::list<Composite*> selection_;
};


/** Used to inform MainControl of selection in MolecularControl (not the one of the checkboxes!) 
 		and the other way round. \par
	  MolecularControl -> MainControl and \par
		MainControl -> MolecularControl
 */
class BALL_VIEW_EXPORT ControlSelectionMessage: public GenericSelectionMessage
{
	public:
	ControlSelectionMessage();
};


/** Send by MainControl to Control objects to sync selection
 */
class BALL_VIEW_EXPORT NewSelectionMessage: public Message
{
	public:
	NewSelectionMessage();

	/// Open all SelectableListViewItems, if they have a selected child
	bool openItems()
		 { return open_;}

	///
	void setOpenItems(bool state)
		 { open_ = state;}

	protected:
	 bool open_;
};

/** GeometricObjectSelectionMessage class. \par
		Sent by Scene after picking GeometricObject. \par
		Caught by MainControl.
*/
class BALL_VIEW_EXPORT GeometricObjectSelectionMessage: public Message
{
	public:

	/**	@name	Constructors and Destructors
	*/	
	//@{

	/** Default Constructor.
	*/
	GeometricObjectSelectionMessage();

	/** Destructor.
	*/
	virtual ~GeometricObjectSelectionMessage();

	//@}
	/**	@name	Accessors: inspectors and mutators 
	*/
	//@{
	
	/** Change the selection of Composite objects.
			The selection list will be copied from the given list.
	*/
	void setSelection(const std::list<GeometricObject*>& selection)
		 { selection_ = selection;}

	/** Non-mutable inspection of the selection of Composite objects.
	*/
	const std::list<GeometricObject*>& getSelection() const
		 { return selection_;}

	/// Set the GeometricObject's to be selected or deselected
	void setSelected(bool state)
		 { state_ = state;}

	/// Query if the GeometricObject are selected or deselected
	bool isSelected() const
		 { return state_;}

	//@}

	private:

	std::list<GeometricObject*> selection_;

	bool state_;
};


class Representation;

/// Base class for all messages concerning a Representation
class BALL_VIEW_EXPORT RepresentationMessage: public Message
{
	public:

	/// Types of RepresentationMessage
	enum RepresentationMessageType
	{
		/// Default Value
		UNDEFINED = -1,

		/// Add a Representation
		ADD = 0,

		/// Remove a Representation
		REMOVE,

		/// Update the Representation
		UPDATE,

		/// Representation was selected in GeometriControl
		SELECTED,

		/// Started the update of a Representation, no changes allowed in GeometricControl
		STARTED_UPDATE,

		/// Finished the update of a Representation
		FINISHED_UPDATE,

		/// Add a Representation to GeometricControl, but don't update in Scene
		ADD_TO_GEOMETRIC_CONTROL,

		/// Update properties of Representation in GeometricControl, but don't update in Scene
		UPDATE_PROPERTIES
	};

	///
	RepresentationMessage();
	
	///
	virtual ~RepresentationMessage();

	///
	RepresentationMessage(Representation& rep, RepresentationMessageType type);

	///
	void setRepresentation(Representation& rep)
		 {representation_ = &rep;}

	///
	Representation* getRepresentation() 
		 {return representation_;}

	///
	void setType(RepresentationMessageType type);

	///
	RepresentationMessageType getType() const
		 { return type_;}
	
	private:

	Representation* 					representation_;
	RepresentationMessageType type_;
};
	

/** Message to perform specific tasks for molecular items.\par
		Send by MolecularControl to MolecularProperties.
 */
class BALL_VIEW_EXPORT MolecularTaskMessage
	: public Message
{
	public:

	/// Enum for the different molecular tasks
	enum MolecularTaskMessageType
	{
		///
		UNDEFINED = -1,
		///
		BUILD_BONDS,
		///
		CHECK_RESIDUE,
		///
		ADD_HYDROGENS,
		///
		CREATE_DISTANCE_GRID
	};

	///
	MolecularTaskMessage(MolecularTaskMessageType type = UNDEFINED);

	///
	void setType(MolecularTaskMessageType type);

	///
	MolecularTaskMessageType getType() const
		 {return type_;}

	protected:
	
	MolecularTaskMessageType type_;
};


/** Notify the DisplayProperties dialog to show itself.\par
 		Send by the GeometriControl and MolecularControl.
*/
class BALL_VIEW_EXPORT ShowDisplayPropertiesMessage
	:public Message
{
	public:
		///
		ShowDisplayPropertiesMessage()
			: Message(){};
};

/** Notify the DisplayProperties dialog so that it creates a new Representation. \par
 		Send by the MolecularControl.
*/
class BALL_VIEW_EXPORT CreateRepresentationMessage
	:public Message
{
	public:
		///
		CreateRepresentationMessage();

		///
		CreateRepresentationMessage(const std::list<Composite*>& composites,
																ModelType model_type, 
																ColoringMethod coloring_method)
			;   

		///
		const std::list<Composite*>& getComposites() const
			 { return composites_;}

		///
		ModelType getModelType() const
 			 { return model_type_;}
		
		///
		ColoringMethod getColoringMethod() const
			 { return coloring_method_;} 
	
 		private: 
		std::list<Composite*> 	composites_;
		ModelType 				model_type_;
		ColoringMethod 		coloring_method_;
};
	

/** Message send by one GenericControl to notify all other GenericControl instances to
 		deselect their QListView.
*/
class BALL_VIEW_EXPORT DeselectControlsMessage
	: public Message
{
	public:
		DeselectControlsMessage()
			: Message() {};
};


///
class BALL_VIEW_EXPORT TransformationMessage
	: public Message
{
	public:

	///
	TransformationMessage();

	///
	TransformationMessage(const Matrix4x4& m);

	///
	void setMatrix(const Matrix4x4& m)
		 { matrix_ = m;}

	///
	const Matrix4x4& getMatrix() const
		 { return matrix_;}

	private:

	Matrix4x4 matrix_;
};


///
class BALL_VIEW_EXPORT FinishedSimulationMessage
	: public Message
{
	public:

	///
	FinishedSimulationMessage();
};
	

///
class BALL_VIEW_EXPORT SyncClippingPlanesMessage
	: public Message
{
	public:

	///
	SyncClippingPlanesMessage(){};
};


///
class BALL_VIEW_EXPORT ShowHelpMessage
	: public Message
{
	public:

	///
	ShowHelpMessage(String url = "", String project = "BALLView", String entry = "");

	String getURL() const { return url_;}

	String getProject() const { return project_;}

	String getEntry() const { return entry_;}

	protected:

	String url_;
	String project_;
	String entry_;
};


/** Register a QObject to a URL in the documentation
 		This message is send by ModularWidget::registerForHelpSystem and should
		probably not be used otherwise.
*/
class BALL_VIEW_EXPORT RegisterHelpSystemMessage
	: public Message
{
	public:

	///
	RegisterHelpSystemMessage();

	///
	void setObject(const QObject* object) { object_ = object;}

	///
	void setURL(const String& url) { url_ = url;}

	///
	void setRegisterMode(bool state) { register_ = state;}

	///
	const QObject* getObject() const { return object_;}

	///
	const String& getURL() const { return url_;}

	///
	bool isRegister() const { return register_;}

	protected:

	const QObject* object_;
	Index 	 menu_entry_;
	String 	 url_;
	bool  	 register_;
};



/// Message to notify docking has finished
class BALL_VIEW_EXPORT DockingFinishedMessage
	:public Message
{
	public:
		///
		DockingFinishedMessage();

		///
		DockingFinishedMessage(bool abort);
			 
		///
		virtual ~DockingFinishedMessage();
			
		///
		void setConformationSet(const ConformationSet* conformation_set)
		{
			conformation_set_ = conformation_set;
		}
		
		//
		const ConformationSet* getConformationSet() const { return conformation_set_; }
		
		///
		bool wasAborted() { return abort_; }

	protected:

		/// this conformation set is deleted in DockResult
		const ConformationSet* conformation_set_;
		bool abort_;
};

//@}

#	ifndef BALL_NO_INLINE_FUNCTIONS
#		include <BALL/VIEW/KERNEL/message.iC>
#	endif
  			
} } // namespaces

#endif // BALL_VIEW_KERNEL_MESSAGE_H