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 _PREVIEWBASE_HXX_
25 #define _PREVIEWBASE_HXX_
26 
27 #include <sal/types.h>
28 #include <com/sun/star/uno/Sequence.hxx>
29 #include <com/sun/star/uno/RuntimeException.hpp>
30 #include <com/sun/star/lang/IllegalArgumentException.hpp>
31 #include <com/sun/star/uno/Any.hxx>
32 
33 #if defined _MSC_VER
34 #pragma warning(push, 1)
35 #endif
36 #include <windows.h>
37 #if defined _MSC_VER
38 #pragma warning(pop)
39 #endif
40 
41 //---------------------------------------------
42 // Common interface for previews
43 //---------------------------------------------
44 
45 class PreviewBase
46 {
47 public:
48 	PreviewBase();
49 
50     // dtor
51 	virtual ~PreviewBase();
52 
53     virtual sal_Int32 SAL_CALL getTargetColorDepth()
54 		throw (::com::sun::star::uno::RuntimeException);
55 
56     virtual sal_Int32 SAL_CALL getAvailableWidth()
57 		throw (::com::sun::star::uno::RuntimeException);
58 
59     virtual sal_Int32 SAL_CALL getAvailableHeight()
60 		throw (::com::sun::star::uno::RuntimeException);
61 
62     virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage )
63 		throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
64 
65     virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState )
66 		throw (::com::sun::star::uno::RuntimeException);
67 
68     virtual sal_Bool SAL_CALL getShowState()
69 		throw (::com::sun::star::uno::RuntimeException);
70 
71 	virtual void SAL_CALL getImage(sal_Int16& aImageFormat,com::sun::star::uno::Any& aImage);
72 
73 	sal_Bool SAL_CALL getImaginaryShowState() const;
74 
75 	virtual HWND SAL_CALL getWindowHandle() const;
76 
77 protected:
78 	::com::sun::star::uno::Any m_ImageData;
79 	sal_Int16				   m_ImageFormat;
80 	sal_Bool				   m_bShowState;
81 };
82 
83 
84 #endif
85