CRenderedDocumentPreviewGeneratorComp.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 // ACF includes
5 #include <istd/TPointerVector.h>
6 #include <imod/IModel.h>
9 #include <iimg/IBitmap.h>
11 #include <icomp/CComponentBase.h>
12 #include <iproc/IProcessor.h>
13 
14 
15 namespace idocproc
16 {
17 
18 
20  public icomp::CComponentBase,
21  public imod::TSingleModelObserverBase<idoc::IMultiPageDocument>,
22  virtual public iimg::IMultiBitmapProvider
23 {
24 public:
27 
28  I_BEGIN_COMPONENT(CRenderedDocumentPreviewGeneratorComp);
29  I_REGISTER_INTERFACE(iimg::IMultiBitmapProvider);
30  I_REGISTER_INTERFACE(imod::IObserver);
31  I_ASSIGN(m_bitmapFactoryCompPtr, "BitmapFactory", "Factory for the preview bitmap creation", false, "BitmapFactory");
32  I_ASSIGN(m_renderingProcessorCompPtr, "RenderingProcessor", "Processor used for page rendering into a bitmap", true, "RenderingProcessor");
33  I_ASSIGN(m_imageSizeAttrPtr, "ImageSize", "Image size in pixel using for rendering of the document page", true, 4096);
34  I_ASSIGN(m_pageSelectionAttrPtr, "PageSelectionParamId", "ID of the page selection in the parameter set used by the rendering processor", true, "PageSelection");
35  I_END_COMPONENT;
36 
37  // reimplemented (iimg::IMultiBitmapProvider)
38  virtual const iprm::IOptionsList* GetBitmapListInfo() const;
39  virtual int GetBitmapsCount() const;
40  virtual const iimg::IBitmap* GetBitmap(int bitmapIndex) const;
41 
42 protected:
43  virtual void EnsurePreviewGenerated();
44 
45  // reimplemented (imod::IObserver)
46  virtual bool OnModelDetached(imod::IModel* modelPtr);
47 
48  // reimplemented (imod::CSingleModelObserverBase)
49  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
50 
51 protected:
52  I_FACT(iimg::IBitmap, m_bitmapFactoryCompPtr);
53  I_REF(iproc::IProcessor, m_renderingProcessorCompPtr);
54  I_ATTR(int, m_imageSizeAttrPtr);
55  I_ATTR(QByteArray, m_pageSelectionAttrPtr);
56 
58 
60 };
61 
62 
63 } // namespace idocproc
64 
65 
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet)
imod::TSingleModelObserverBase< idoc::IMultiPageDocument > BaseClass2
virtual bool OnModelDetached(imod::IModel *modelPtr)
Interface for all synchrone and asynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual const iprm::IOptionsList * GetBitmapListInfo() const
virtual const iimg::IBitmap * GetBitmap(int bitmapIndex) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy