1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef __FRAMEWORK_JOBS_JOBRESULT_HXX_ 29*cdf0e10cSrcweir #define __FRAMEWORK_JOBS_JOBRESULT_HXX_ 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir //_______________________________________ 32*cdf0e10cSrcweir // my own includes 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx> 35*cdf0e10cSrcweir #include <macros/debug.hxx> 36*cdf0e10cSrcweir #include <stdtypes.h> 37*cdf0e10cSrcweir #include <general.h> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir //_______________________________________ 40*cdf0e10cSrcweir // interface includes 41*cdf0e10cSrcweir #include <com/sun/star/beans/NamedValue.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/frame/DispatchResultEvent.hpp> 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir //_______________________________________ 45*cdf0e10cSrcweir // other includes 46*cdf0e10cSrcweir #include <rtl/ustring.hxx> 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir //_______________________________________ 49*cdf0e10cSrcweir // namespace 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir namespace framework{ 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir //_______________________________________ 54*cdf0e10cSrcweir // public const 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir //_______________________________________ 57*cdf0e10cSrcweir /** 58*cdf0e10cSrcweir @short represent a result of a finished job execution 59*cdf0e10cSrcweir @descr Such result instance transport all neccessarry 60*cdf0e10cSrcweir data from the code place where the job was finished 61*cdf0e10cSrcweir to the outside code, where e.g. listener must be notified. 62*cdf0e10cSrcweir */ 63*cdf0e10cSrcweir class JobResult : private ThreadHelpBase 64*cdf0e10cSrcweir { 65*cdf0e10cSrcweir //___________________________________ 66*cdf0e10cSrcweir // types 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir public: 69*cdf0e10cSrcweir 70*cdf0e10cSrcweir /** 71*cdf0e10cSrcweir These enum values are used to build a flag mask of possible set 72*cdf0e10cSrcweir parts of an analyzed pure job execution result. 73*cdf0e10cSrcweir An user of this class can decide, if a member of us can be valid 74*cdf0e10cSrcweir or not. So it can indicate, if a job used the special part inside 75*cdf0e10cSrcweir his returned result protocol. 76*cdf0e10cSrcweir To be usable as flags - it must be values of set {0,1,2,4,8,16 ...}! 77*cdf0e10cSrcweir */ 78*cdf0e10cSrcweir enum EParts 79*cdf0e10cSrcweir { 80*cdf0e10cSrcweir E_NOPART = 0, 81*cdf0e10cSrcweir E_ARGUMENTS = 1, 82*cdf0e10cSrcweir E_DEACTIVATE = 2, 83*cdf0e10cSrcweir E_DISPATCHRESULT = 4 84*cdf0e10cSrcweir }; 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir //___________________________________ 87*cdf0e10cSrcweir // member 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir private: 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir /** hold the original pure result, which was given back by an 92*cdf0e10cSrcweir executed job 93*cdf0e10cSrcweir We analyze it and use it to set all our other members. 94*cdf0e10cSrcweir */ 95*cdf0e10cSrcweir css::uno::Any m_aPureResult; 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir /** 98*cdf0e10cSrcweir an user of us must know, which (possible) parts of 99*cdf0e10cSrcweir a "pure result" was realy set by an executed job. 100*cdf0e10cSrcweir Means which other members of this class are valid. 101*cdf0e10cSrcweir This mask can be used to find it out. 102*cdf0e10cSrcweir */ 103*cdf0e10cSrcweir sal_uInt32 m_eParts; 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir /** 106*cdf0e10cSrcweir a job can have persistent data 107*cdf0e10cSrcweir They are part of the pure result and will be used to 108*cdf0e10cSrcweir write it to the configuration. But that's part of any 109*cdf0e10cSrcweir user of us. We provide this information here only. 110*cdf0e10cSrcweir */ 111*cdf0e10cSrcweir css::uno::Sequence< css::beans::NamedValue > m_lArguments; 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir /** 114*cdf0e10cSrcweir an executed job can force his deactivation 115*cdf0e10cSrcweir But we provide this information here only. 116*cdf0e10cSrcweir Doing so is part of any user of us. 117*cdf0e10cSrcweir */ 118*cdf0e10cSrcweir sal_Bool m_bDeactivate; 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir /** 121*cdf0e10cSrcweir represent the part "DispatchResult" 122*cdf0e10cSrcweir It's a full filled event type, which was given 123*cdf0e10cSrcweir back by the executed job. Any user of us can send 124*cdf0e10cSrcweir it to his registered result listener directly. 125*cdf0e10cSrcweir */ 126*cdf0e10cSrcweir css::frame::DispatchResultEvent m_aDispatchResult; 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir //___________________________________ 129*cdf0e10cSrcweir // native interface 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir public: 132*cdf0e10cSrcweir 133*cdf0e10cSrcweir JobResult( ); 134*cdf0e10cSrcweir JobResult( const com::sun::star::uno::Any& aResult ); 135*cdf0e10cSrcweir JobResult( const JobResult& rCopy ); 136*cdf0e10cSrcweir virtual ~JobResult( ); 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir void operator=( const JobResult& rCopy ); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir sal_Bool existPart ( sal_uInt32 eParts ) const; 141*cdf0e10cSrcweir css::uno::Sequence< css::beans::NamedValue > getArguments ( ) const; 142*cdf0e10cSrcweir css::frame::DispatchResultEvent getDispatchResult( ) const; 143*cdf0e10cSrcweir }; 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir } // namespace framework 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir #endif // __FRAMEWORK_JOBS_JOBRESULT_HXX_ 148