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 #ifndef _CONTROLCOMMANDRESULT_HXX_
25 #define _CONTROLCOMMANDRESULT_HXX_
26 
27 //------------------------------------------------------------------------
28 // includes
29 //------------------------------------------------------------------------
30 
31 #include <sal/types.h>
32 #include <com/sun/star/uno/Any.hxx>
33 #include <rtl/ustring.hxx>
34 
35 //---------------------------------------------
36 // declaration
37 //---------------------------------------------
38 
39 class CControlCommandResult
40 {
41 public:
CControlCommandResult(sal_Bool bResult=sal_False)42     CControlCommandResult( sal_Bool bResult = sal_False ) :
43         m_bResult( bResult )
44     {
45     }
46 
~CControlCommandResult()47     virtual ~CControlCommandResult( )
48     {
49     }
50 
hasResult() const51     sal_Bool SAL_CALL hasResult( ) const
52     {
53         return m_bResult;
54     }
55 
56 private:
57     sal_Bool m_bResult;
58 };
59 
60 //---------------------------------------------
61 //
62 //---------------------------------------------
63 
64 class CValueCommandResult : public CControlCommandResult
65 {
66 public:
CValueCommandResult(sal_Bool bResult,const::com::sun::star::uno::Any & aValue)67     CValueCommandResult( sal_Bool bResult, const ::com::sun::star::uno::Any& aValue ) :
68         CControlCommandResult( bResult ),
69         m_aValue( aValue )
70     {
71     }
72 
getValue() const73     ::com::sun::star::uno::Any SAL_CALL getValue( ) const
74     {
75         return m_aValue;
76     }
77 
78 private:
79     ::com::sun::star::uno::Any m_aValue;
80 };
81 
82 //---------------------------------------------
83 //
84 //---------------------------------------------
85 
86 class CLabelCommandResult : public CControlCommandResult
87 {
88 public:
CLabelCommandResult(sal_Bool bResult,const rtl::OUString & aLabel)89     CLabelCommandResult( sal_Bool bResult, const rtl::OUString& aLabel ) :
90         CControlCommandResult( bResult ),
91         m_aLabel( aLabel )
92     {
93     }
94 
getLabel() const95     rtl::OUString SAL_CALL getLabel( ) const
96     {
97         return m_aLabel;
98     }
99 
100 private:
101     rtl::OUString m_aLabel;
102 };
103 
104 #endif
105