summaryrefslogtreecommitdiff
path: root/framework/inc/services/task.hxx
blob: d90136304ab4252c8113e5bde65e71c3d8ab819b (plain)
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
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org 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 version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifndef __FRAMEWORK_SERVICES_TASK_HXX_
#define __FRAMEWORK_SERVICES_TASK_HXX_

//_________________________________________________________________________________________________________________
//	my own includes
//_________________________________________________________________________________________________________________

#include <services/frame.hxx>
#include <macros/generic.hxx>
#include <macros/debug.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>

//_________________________________________________________________________________________________________________
//	interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/frame/XTask.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>

//_________________________________________________________________________________________________________________
//	other includes
//_________________________________________________________________________________________________________________
#include <cppuhelper/weak.hxx>
#include <cppuhelper/propshlp.hxx>

#include <tools/link.hxx>
#include <vcl/evntpost.hxx>

//_________________________________________________________________________________________________________________
//	namespace
//_________________________________________________________________________________________________________________

namespace framework{

//_________________________________________________________________________________________________________________
//	exported const
//_________________________________________________________________________________________________________________

//_________________________________________________________________________________________________________________
//	exported definitions
//_________________________________________________________________________________________________________________

/*-************************************************************************************************************//**
    @short		implements an special frame - a task frame

    @descr		-

    @implements	XTask

    @base		Frame
                OPropertySet
*//*-*************************************************************************************************************/

class Task  :   public css::frame::XTask    ,   // => XFrame => XComponent
                public Frame                    // Order of baseclasses is neccessary for right initialization!
{
    //-------------------------------------------------------------------------------------------------------------
    //	public methods
    //-------------------------------------------------------------------------------------------------------------

    public:

        //---------------------------------------------------------------------------------------------------------
        //	constructor / destructor
        //---------------------------------------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		standard constructor to create instance

            @descr		This constructor initialize a new instance of this class,
                        and will be set valid values on his member and baseclasses.

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

         Task( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );

        /*-****************************************************************************************************//**
            @short		standard destructor

            @descr		This method destruct an instance of this class and clear some member.

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual	~Task();

        //---------------------------------------------------------------------------------------------------------
        //	XInterface, XTypeProvider, XServiceInfo
        //---------------------------------------------------------------------------------------------------------

        DECLARE_XINTERFACE
        DECLARE_XTYPEPROVIDER
        DECLARE_XSERVICEINFO

        //---------------------------------------------------------------------------------------------------------
        //	XTask
        //---------------------------------------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		-

            @descr		-

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual sal_Bool SAL_CALL close() throw( css::uno::RuntimeException );

        /*-****************************************************************************************************//**
            @short		-

            @descr		-

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL tileWindows() throw( css::uno::RuntimeException );

        /*-****************************************************************************************************//**
            @short		-

            @descr		-

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL arrangeWindowsVertical() throw( css::uno::RuntimeException );

        /*-****************************************************************************************************//**
            @short		-

            @descr		-

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL arrangeWindowsHorizontal() throw( css::uno::RuntimeException );

        //---------------------------------------------------------------------------------------------------------
        //	 XComponent
        //---------------------------------------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		-

            @descr		We must overwrite this method, because baseclass Frame implements XFrame and XComponent.
                        XTask is derived from these classes to! The compiler don't know, which base is the right one.

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL dispose() throw( css::uno::RuntimeException )
        {
            Frame::dispose();
        }

        /*-*******************************************************************************************************/
        virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException )
        {
            Frame::addEventListener( xListener );
        }

        /*-*******************************************************************************************************/
        virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException )
        {
            Frame::removeEventListener( xListener );
        }

        //---------------------------------------------------------------------------------------------------------
        //	 XFrame
        //---------------------------------------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		-

            @descr		We must overwrite this method, because baseclass Frame implements XFrame and XComponent.
                        XTask is derived from these classes to! The compiler don't know, which base is right.

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL initialize( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException )
        {
            Frame::initialize( xWindow );
        }

        virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow() throw( css::uno::RuntimeException )
        {
            return Frame::getContainerWindow();
        }

        virtual void SAL_CALL setCreator( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException )
        {
            Frame::setCreator( xCreator );
        }

        virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator() throw( css::uno::RuntimeException )
        {
            return Frame::getCreator();
        }

        virtual ::rtl::OUString SAL_CALL getName() throw( css::uno::RuntimeException )
        {
            return Frame::getName();
        }

        virtual void SAL_CALL setName( const ::rtl::OUString& sName ) throw( css::uno::RuntimeException )
        {
            Frame::setName( sName );
        }

        virtual sal_Bool SAL_CALL isTop() throw( css::uno::RuntimeException )
        {
            return Frame::isTop();
        }

        virtual void SAL_CALL activate() throw( css::uno::RuntimeException )
        {
            Frame::activate();
        }

        virtual void SAL_CALL deactivate() throw( css::uno::RuntimeException )
        {
            Frame::deactivate();
        }

        virtual sal_Bool SAL_CALL isActive() throw( css::uno::RuntimeException )
        {
            return Frame::isActive();
        }

        virtual sal_Bool SAL_CALL setComponent(	const	css::uno::Reference< css::awt::XWindow >&		xComponentWindow	,
                                                const	css::uno::Reference< css::frame::XController >&	xController			) throw( css::uno::RuntimeException )
        {
            return Frame::setComponent( xComponentWindow, xController );
        }

        virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() throw( css::uno::RuntimeException )
        {
            return Frame::getComponentWindow();
        }

        virtual css::uno::Reference< css::frame::XController > SAL_CALL getController() throw( css::uno::RuntimeException )
        {
            return Frame::getController();
        }

        virtual void SAL_CALL contextChanged() throw( css::uno::RuntimeException )
        {
            Frame::contextChanged();
        }

        virtual void SAL_CALL addFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException )
        {
            Frame::addFrameActionListener( xListener );
        }

        virtual void SAL_CALL removeFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException )
        {
            Frame::removeFrameActionListener( xListener );
        }

        virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame(	const	::rtl::OUString&	sTargetFrameName	,
                                                                                           sal_Int32			nSearchFlags		) throw( css::uno::RuntimeException );

        //---------------------------------------------------------------------------------------------------------
        //	 XTopWindowListener
        //---------------------------------------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		-

            @descr		-

            @seealso	-
            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL windowClosing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );

        /*-****************************************************************************************************//**
            @short		-

            @descr		-

            @seealso	-
            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL windowActivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );

        /*-****************************************************************************************************//**
            @short		-

            @descr		-

            @seealso	-
            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL windowDeactivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );

        //---------------------------------------------------------------------------------------------------------
        //	 XEventListener
        //---------------------------------------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		-

            @descr		This object is forced to release all references to the interfaces given
                        by the parameter Source.

            @seealso	-

            @param		-

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/

        virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );

    //-------------------------------------------------------------------------------------------------------------
    //	protected methods
    //-------------------------------------------------------------------------------------------------------------

    protected:

        //---------------------------------------------------------------------------
        //	OPropertySetHelper
        //---------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		try to convert a property value
            @descr		This method is calling from helperclass "OPropertySetHelper".
                        Don't use this directly!
                        You must try to convert the value of given propertyhandle and
                        return results of this operation. This will be use to ask vetoable
                        listener. If no listener have a veto, we will change value realy!
                        ( in method setFastPropertyValue_NoBroadcast(...) )

            @seealso	OPropertySetHelper
            @seealso	setFastPropertyValue_NoBroadcast()

            @param		"aConvertedValue"	new converted value of property
            @param		"aOldValue"			old value of property
            @param		"nHandle"			handle of property
            @param		"aValue"			new value of property

            @return		sal_True if value will be changed, sal_FALSE otherway

            @onerror	IllegalArgumentException, if you call this with an invalid argument
        *//*-*****************************************************************************************************/
/*
        virtual sal_Bool SAL_CALL convertFastPropertyValue(			css::uno::Any&		aConvertedValue	,
                                                                      css::uno::Any&		aOldValue		,
                                                                    sal_Int32			nHandle			,
                                                            const	css::uno::Any&		aValue			) throw( css::lang::IllegalArgumentException );
*/
        /*-****************************************************************************************************//**
            @short		set value of a transient property
            @descr		This method is calling from helperclass "OPropertySetHelper".
                        Don't use this directly!
                        Handle and value are valid everyway! You must set the new value only.
                        After this, baseclass send messages to all listener automaticly.

            @seealso	OPropertySetHelper

            @param      "nHandle"	handle of property to change
            @param      "aValue"	new value of property

            @return		-

            @onerror	An exception is thrown.
        *//*-*****************************************************************************************************/
/*
        virtual void SAL_CALL setFastPropertyValue_NoBroadcast(			sal_Int32		nHandle	,
                                                                  const	css::uno::Any&	aValue	) throw( css::uno::Exception );
*/
        /*-****************************************************************************************************//**
            @short		get value of a transient property
            @descr		This method is calling from helperclass "OPropertySetHelper".
                        Don't use this directly!

            @seealso	OPropertySetHelper

            @param      "nHandle"	handle of property to change
            @param      "aValue"	current value of property

            @return		-

            @onerror	-
        *//*-*****************************************************************************************************/
/*
        virtual void SAL_CALL getFastPropertyValue(	css::uno::Any&	aValue	,
                                                      sal_Int32		nHandle	) const;
*/
        /*-****************************************************************************************************//**
            @short      return structure and information about transient properties
            @descr		This method is calling from helperclass "OPropertySetHelper".
                        Don't use this directly!

            @seealso	OPropertySetHelper

            @param		-

            @return		structure with property-informations

            @onerror	-
        *//*-*****************************************************************************************************/
/*
        virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
*/
        /*-****************************************************************************************************//**
            @short		return propertysetinfo
            @descr		You can call this method to get information about transient properties
                        of this object.

            @seealso	OPropertySetHelper
            @seealso	XPropertySet
            @seealso	XMultiPropertySet

            @param		-

            @return		reference to object with information [XPropertySetInfo]

            @onerror	-
        *//*-*****************************************************************************************************/
/*
        virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo();
*/
    //-------------------------------------------------------------------------------------------------------------
    //	private methods
    //-------------------------------------------------------------------------------------------------------------

    private:

        DECL_LINK( Close_Impl, void* );

//        void    impl_SaveWindowAttributes();

/*		sal_Bool impl_tryToChangeProperty(			sal_Bool			bProperty		,
                                            const	css::uno::Any&		aValue			,
                                                    css::uno::Any&		aOldValue		,
                                                    css::uno::Any&		aConvertedValue	) throw( css::lang::IllegalArgumentException );
        sal_Bool impl_tryToChangeProperty(	const	::rtl::OUString&	sProperty		,
                                            const	css::uno::Any&		aValue			,
                                                    css::uno::Any&		aOldValue		,
                                                    css::uno::Any&		aConvertedValue	) throw( css::lang::IllegalArgumentException );
        sal_Bool impl_tryToChangeProperty(	const	css::awt::Point&	aProperty		,
                                            const	css::uno::Any&		aValue			,
                                                    css::uno::Any&		aOldValue		,
                                                    css::uno::Any&		aConvertedValue	) throw( css::lang::IllegalArgumentException );
        sal_Bool impl_tryToChangeProperty(	const	css::awt::Size&		aProperty		,
                                            const	css::uno::Any&		aValue			,
                                                    css::uno::Any&		aOldValue		,
                                                    css::uno::Any&		aConvertedValue	) throw( css::lang::IllegalArgumentException );

        static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor();
*/

    //-------------------------------------------------------------------------------------------------------------
    //	debug methods
    //	(should be private everyway!)
    //-------------------------------------------------------------------------------------------------------------

        /*-****************************************************************************************************//**
            @short		debug-method to check incoming parameter of some other mehods of this class
            @descr		The following methods are used to check parameters for other methods
                        of this class. The return value is used directly for an ASSERT(...).

            @seealso	ASSERTs in implementation!

            @param		references to checking variables
            @return		sal_False on invalid parameter<BR>
                        sal_True  otherway

            @onerror	-
        *//*-*****************************************************************************************************/

    #ifdef ENABLE_ASSERTIONS

    private:

        // Not used in the moment!

    #endif	// #ifdef ENABLE_ASSERTIONS

    //-------------------------------------------------------------------------------------------------------------
    //	variables
    //	(should be private everyway!)
    //-------------------------------------------------------------------------------------------------------------

    protected:

        // But some values are neede by derived classes!
//        sal_Bool            m_bIsPlugIn         ;   /// In objects of these class this member is set to FALSE.
                                                    /// But in derived class PlugInFrame it's overwrited with TRUE!

    private:

        // Properties
        sal_Bool            m_bIsAlwaysVisible  ;
        sal_Bool            m_bIsFloating       ;
        css::awt::Point		m_aPosition         ;
        css::awt::Size		m_aSize             ;
        ::vcl::EventPoster  m_aPoster           ;

};		//	class Tasks

}		//	namespace framework

#endif	//	#ifndef __FRAMEWORK_SERVICES_TASKS_HXX_

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */