xref: /aoo41x/main/svtools/source/plugapp/ttprops.cxx (revision 5900e8ec)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svtools.hxx"
26 #include <svtools/ttprops.hxx>
27 #include <vcl/svapp.hxx>
28 #include <vcl/bitmap.hxx>
29 #include <tools/rtti.hxx>
30 
TYPEINIT1(TTProperties,ApplicationProperty)31 TYPEINIT1( TTProperties, ApplicationProperty )
32 
33 sal_Bool TTProperties::RequestProperty( sal_uInt16 nRequest )
34 {
35 	if ( (( nRequest & TT_PR_ONCE ) == 0) || (nDonePRs & (nRequest & 0x0ff)) == 0 )
36 	{
37 		nActualPR = nRequest;
38 		nDonePRs |= nRequest;
39 		GetpApp()->Property( *this );
40 		return nActualPR == 0;
41 	}
42 	return sal_True;
43 }
44 
45 
GetSlots()46 sal_Bool TTProperties::GetSlots()
47 {
48 	RequestProperty( TT_PR_SLOTS );
49 	return HasSlots();
50 }
51 
ExecuteFunction(sal_uInt16 nSID,SfxPoolItem ** ppArgs,sal_uInt16 nMode)52 sal_uInt16 TTProperties::ExecuteFunction( sal_uInt16 nSID, SfxPoolItem** ppArgs, sal_uInt16 nMode )
53 {
54 	mnSID = nSID;
55 	mppArgs = ppArgs;
56 	mnMode = nMode;
57 	RequestProperty( TT_PR_DISPATCHER );
58 	mppArgs = NULL;
59 	return nActualPR;
60 }
61 
Img(Bitmap * pBmp)62 sal_Bool TTProperties::Img( Bitmap *pBmp )
63 {
64 	sal_Bool bRet;
65 	mpBmp = pBmp;
66 	bRet = RequestProperty( TT_PR_IMG );
67 	mpBmp = NULL;
68 	return bRet;
69 }
70 
GetSvtResId(sal_uInt16 nId)71 SvtResId TTProperties::GetSvtResId( sal_uInt16 nId )
72 {
73 	return SvtResId( nId );
74 }
75 
76