bump product version to 4.1.6.2
[LibreOffice.git] / framework / inc / jobs / jobresult.hxx
blobee122f1ff2f2e43b024c958b10c0da74d38c046e
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 __FRAMEWORK_JOBS_JOBRESULT_HXX_
21 #define __FRAMEWORK_JOBS_JOBRESULT_HXX_
23 #include <threadhelp/threadhelpbase.hxx>
24 #include <macros/debug.hxx>
25 #include <stdtypes.h>
26 #include <general.h>
28 #include <com/sun/star/beans/NamedValue.hpp>
29 #include <com/sun/star/frame/DispatchResultEvent.hpp>
31 #include <rtl/ustring.hxx>
34 namespace framework{
37 //_______________________________________
38 /**
39 @short represent a result of a finished job execution
40 @descr Such result instance transport all neccessarry
41 data from the code place where the job was finished
42 to the outside code, where e.g. listener must be notified.
44 class JobResult : private ThreadHelpBase
46 //___________________________________
47 // types
49 public:
51 /**
52 These enum values are used to build a flag mask of possible set
53 parts of an analyzed pure job execution result.
54 An user of this class can decide, if a member of us can be valid
55 or not. So it can indicate, if a job used the special part inside
56 his returned result protocol.
57 To be usable as flags - it must be values of set {0,1,2,4,8,16 ...}!
59 enum EParts
61 E_NOPART = 0,
62 E_ARGUMENTS = 1,
63 E_DEACTIVATE = 2,
64 E_DISPATCHRESULT = 4
67 //___________________________________
68 // member
70 private:
72 /** hold the original pure result, which was given back by an
73 executed job
74 We analyze it and use it to set all our other members.
76 css::uno::Any m_aPureResult;
78 /**
79 an user of us must know, which (possible) parts of
80 a "pure result" was realy set by an executed job.
81 Means which other members of this class are valid.
82 This mask can be used to find it out.
84 sal_uInt32 m_eParts;
86 /**
87 a job can have persistent data
88 They are part of the pure result and will be used to
89 write it to the configuration. But that's part of any
90 user of us. We provide this information here only.
92 css::uno::Sequence< css::beans::NamedValue > m_lArguments;
94 /**
95 an executed job can force his deactivation
96 But we provide this information here only.
97 Doing so is part of any user of us.
99 sal_Bool m_bDeactivate;
102 represent the part "DispatchResult"
103 It's a full filled event type, which was given
104 back by the executed job. Any user of us can send
105 it to his registered result listener directly.
107 css::frame::DispatchResultEvent m_aDispatchResult;
109 //___________________________________
110 // native interface
112 public:
114 JobResult( );
115 JobResult( const com::sun::star::uno::Any& aResult );
116 JobResult( const JobResult& rCopy );
117 virtual ~JobResult( );
119 void operator=( const JobResult& rCopy );
121 sal_Bool existPart ( sal_uInt32 eParts ) const;
122 css::uno::Sequence< css::beans::NamedValue > getArguments ( ) const;
123 css::frame::DispatchResultEvent getDispatchResult( ) const;
126 } // namespace framework
128 #endif // __FRAMEWORK_JOBS_JOBRESULT_HXX_
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */