Branch libreoffice-5-0-4
[LibreOffice.git] / dtrans / source / cnttype / mcnttype.hxx
blobe44e12261b217f27b46bd99761cf9a84aa8c4d28
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DTRANS_SOURCE_CNTTYPE_MCNTTYPE_HXX
21 #define INCLUDED_DTRANS_SOURCE_CNTTYPE_MCNTTYPE_HXX
23 #include <cppuhelper/compbase1.hxx>
24 #include <rtl/ustring.hxx>
25 #include <sal/types.h>
26 #include <com/sun/star/lang/IllegalArgumentException.hpp>
27 #include <com/sun/star/datatransfer/XMimeContentType.hpp>
29 #include <map>
31 class CMimeContentType : public
32 cppu::WeakImplHelper1< com::sun::star::datatransfer::XMimeContentType >
34 public:
35 CMimeContentType( const OUString& aCntType );
37 // XMimeContentType
39 virtual OUString SAL_CALL getMediaType( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
40 virtual OUString SAL_CALL getMediaSubtype( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
41 virtual OUString SAL_CALL getFullMediaType( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
43 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getParameters( )
44 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
46 virtual sal_Bool SAL_CALL hasParameter( const OUString& aName )
47 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
49 virtual OUString SAL_CALL getParameterValue( const OUString& aName )
50 throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
52 private:
53 void SAL_CALL init( const OUString& aCntType ) throw( com::sun::star::lang::IllegalArgumentException );
54 void SAL_CALL getSym();
55 void SAL_CALL acceptSym( const OUString& pSymTlb );
56 void SAL_CALL skipSpaces();
57 void SAL_CALL type();
58 void SAL_CALL subtype();
59 void SAL_CALL trailer();
60 OUString SAL_CALL pName( );
61 OUString SAL_CALL pValue( );
62 OUString SAL_CALL quotedPValue( );
63 OUString SAL_CALL nonquotedPValue( );
64 void SAL_CALL comment();
65 static bool SAL_CALL isInRange( const OUString& aChr, const OUString& aRange );
67 private:
68 ::osl::Mutex m_aMutex;
69 OUString m_MediaType;
70 OUString m_MediaSubtype;
71 OUString m_ContentType;
72 std::map< OUString, OUString > m_ParameterMap;
73 sal_Int32 m_nPos;
74 OUString m_nxtSym;
77 #endif
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */