xref: /trunk/main/dtrans/source/cnttype/mcnttype.hxx (revision fbcf0fe9)
1*fbcf0fe9SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*fbcf0fe9SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*fbcf0fe9SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*fbcf0fe9SAndrew Rist  * distributed with this work for additional information
6*fbcf0fe9SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*fbcf0fe9SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*fbcf0fe9SAndrew Rist  * "License"); you may not use this file except in compliance
9*fbcf0fe9SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*fbcf0fe9SAndrew Rist  *
11*fbcf0fe9SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*fbcf0fe9SAndrew Rist  *
13*fbcf0fe9SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*fbcf0fe9SAndrew Rist  * software distributed under the License is distributed on an
15*fbcf0fe9SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*fbcf0fe9SAndrew Rist  * KIND, either express or implied.  See the License for the
17*fbcf0fe9SAndrew Rist  * specific language governing permissions and limitations
18*fbcf0fe9SAndrew Rist  * under the License.
19*fbcf0fe9SAndrew Rist  *
20*fbcf0fe9SAndrew Rist  *************************************************************/
21*fbcf0fe9SAndrew Rist 
22*fbcf0fe9SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef _MCNTTYPE_HXX_
26cdf0e10cSrcweir #define _MCNTTYPE_HXX_
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //------------------------------------------------------------------------
29cdf0e10cSrcweir // includes
30cdf0e10cSrcweir //------------------------------------------------------------------------
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <cppuhelper/compbase1.hxx>
33cdf0e10cSrcweir #include <rtl/ustring.hxx>
34cdf0e10cSrcweir #include <sal/types.h>
35cdf0e10cSrcweir #include <com/sun/star/lang/IllegalArgumentException.hpp>
36cdf0e10cSrcweir #include <com/sun/star/datatransfer/XMimeContentType.hpp>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #include <map>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir //------------------------------------------------------------------------
41cdf0e10cSrcweir // deklarations
42cdf0e10cSrcweir //------------------------------------------------------------------------
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class CMimeContentType : public
45cdf0e10cSrcweir 	cppu::WeakImplHelper1< com::sun::star::datatransfer::XMimeContentType >
46cdf0e10cSrcweir {
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir 	CMimeContentType( const rtl::OUString& aCntType );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	//-------------------------------------------
51cdf0e10cSrcweir 	// XMimeContentType
52cdf0e10cSrcweir 	//-------------------------------------------
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getMediaType(  ) throw(::com::sun::star::uno::RuntimeException);
55cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getMediaSubtype(  ) throw(::com::sun::star::uno::RuntimeException);
56cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getFullMediaType(  ) throw(::com::sun::star::uno::RuntimeException);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getParameters(  )
59cdf0e10cSrcweir 		throw(::com::sun::star::uno::RuntimeException);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasParameter( const ::rtl::OUString& aName )
62cdf0e10cSrcweir 		throw(::com::sun::star::uno::RuntimeException);
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getParameterValue( const ::rtl::OUString& aName )
65cdf0e10cSrcweir 		throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
66cdf0e10cSrcweir 
67cdf0e10cSrcweir private:
68cdf0e10cSrcweir 	void SAL_CALL init( const rtl::OUString& aCntType ) throw( com::sun::star::lang::IllegalArgumentException );
69cdf0e10cSrcweir 	void SAL_CALL getSym( void );
70cdf0e10cSrcweir 	void SAL_CALL acceptSym( const rtl::OUString& pSymTlb );
71cdf0e10cSrcweir 	void SAL_CALL skipSpaces( void );
72cdf0e10cSrcweir 	void SAL_CALL type( void );
73cdf0e10cSrcweir 	void SAL_CALL subtype( void );
74cdf0e10cSrcweir 	void SAL_CALL trailer( void );
75cdf0e10cSrcweir 	rtl::OUString SAL_CALL pName( );
76cdf0e10cSrcweir 	rtl::OUString SAL_CALL pValue( );
77cdf0e10cSrcweir 	rtl::OUString SAL_CALL quotedPValue( );
78cdf0e10cSrcweir 	rtl::OUString SAL_CALL nonquotedPValue( );
79cdf0e10cSrcweir 	void SAL_CALL comment( void );
80cdf0e10cSrcweir 	sal_Bool SAL_CALL isInRange( const rtl::OUString& aChr, const rtl::OUString& aRange );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir private:
83cdf0e10cSrcweir 	::osl::Mutex							 m_aMutex;
84cdf0e10cSrcweir 	rtl::OUString							 m_MediaType;
85cdf0e10cSrcweir 	rtl::OUString							 m_MediaSubtype;
86cdf0e10cSrcweir 	rtl::OUString							 m_ContentType;
87cdf0e10cSrcweir 	std::map< rtl::OUString, rtl::OUString > m_ParameterMap;
88cdf0e10cSrcweir 	sal_Int32								 m_nPos;
89cdf0e10cSrcweir 	rtl::OUString							 m_nxtSym;
90cdf0e10cSrcweir };
91cdf0e10cSrcweir 
92cdf0e10cSrcweir #endif
93cdf0e10cSrcweir 
94