IProgress.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef APP_IPROGRESS_H
00006 #define APP_IPROGRESS_H
00007 
00008 #include <support/IInterface.h>
00009 #include <support/Binder.h>
00010 #include <support/Context.h>
00011 #include <support/String.h>
00012 
00013 /*
00014  * Copyright (c) 2005 Palmsource, Inc.
00015  * 
00016  * This software is licensed as described in the file LICENSE, which
00017  * you should have received as part of this distribution. The terms
00018  * are also available at http://www.openbinder.org/license.html.
00019  * 
00020  * This software consists of voluntary contributions made by many
00021  * individuals. For the exact contribution history, see the revision
00022  * history and logs, available at http://www.openbinder.org
00023  */
00024 
00025 /* ============= Interface Class Declarations =========================== */
00026 
00027 #if _SUPPORTS_NAMESPACE
00028 namespace palmos {
00029 namespace app {
00030 using namespace palmos::support;
00031 #endif /* _SUPPORTS_NAMESPACE */
00032 
00033 class IProgress : public IInterface
00034 {
00035 public:
00036     B_DECLARE_META_INTERFACE(Progress)
00037     
00038     
00039     /* ------- Properties --------------------- */
00040     
00041     
00042     virtual float                   Progress() const = 0;
00044     virtual void                    SetProgress(float value) = 0;
00045     
00047     virtual SString                 Note() const = 0;
00049     virtual void                    SetNote(const SString& value) = 0;
00050     
00052     virtual bool                    IsCanceled() const = 0;
00053     
00054     /* ------- Methods ------------------------ */
00055     
00056     virtual void                    Finish(status_t err) = 0;
00057     
00058     /* ------- inline helpers ------------------------- */
00059     status_t LinkProgress(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00060     {
00061         return AsBinder()->Link(to, mappings, flags);
00062     }
00063     status_t UnlinkProgress(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00064     {
00065         return AsBinder()->Unlink(to, mappings, flags);
00066     }
00067 
00068 protected:
00069                                     IProgress() { }
00070     virtual                         ~IProgress();
00071 
00072 private:
00073     /* ------- copy/assignment protection ------------------ */
00074                                     IProgress(const IProgress& o);
00075             IProgress&              operator=(const IProgress& o);
00076 };
00077 
00078 
00079 /* ============= Local Class Declarations =============================== */
00080 
00081 class BnProgress : public IProgress, public BBinder
00082 {
00083 public:
00084     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00085     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00086     
00087     /* ------- Push Properties ---------------- */
00088 public:
00089             void                    PushProgress(float value);
00090             void                    PushNote(const SString& value);
00091             void                    PushIsCanceled(bool value);
00092 
00093 protected:
00094                                     BnProgress();
00095                                     BnProgress(const SContext& context);
00096     virtual                         ~BnProgress();
00097     
00098     virtual sptr<IBinder>           AsBinderImpl();
00099     virtual sptr<const IBinder>     AsBinderImpl() const;
00100     
00101     /* ------- Marshalling Details ------------ */
00102     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00103     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00104 
00105 private:
00106                                     BnProgress(const BnProgress& o);
00107             BnProgress&             operator=(const BnProgress& o);
00108 };
00109 
00110 
00111 #if _SUPPORTS_NAMESPACE
00112 } } // namespace palmos::app
00113 #endif /* _SUPPORTS_NAMESPACE */
00114 
00115 
00116 // namespace palmos::app
00117 
00118 #endif // APP_IPROGRESS_H
00119