rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Application Framework Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvDvDocViewInterface Class Reference

Application Framework document view base class. More...

#include <ilviews/appframe/view.h>

Inheritance diagram for IlvDvDocViewInterface:
IlvDvSerializable IlvDvInterface IlvDvFormView IlvDvHierarchicalSheetView IlvDvListView IlvDvMatrixView IlvDvSheetView IlvDvTextView IlvDvTreeView IlvDvView

List of all members.

Public Member Functions

IlvDvDocumentgetDocument () const
 Gets the document associated with the view.
IlvDvApplicationgetDvApplication () const
 Gets the application in which the document view is displayed.
virtual IlvAbstractViewgetDvView ()
 Gets the IlvAbstractView of the document view.
virtual IlvGraphicgetGraphic ()
 Gets the graphic object of the document view.
IlvDvViewContainerInterfacegetViewContainer () const
 Gets the document view container that owns the view.
virtual void initializeView ()
 Initializes the document view.
virtual void serialize (IlvDvStream &)
 Serializes the object in the stream stream.
Typically, the body of the method has the following form:
.

Detailed Description

Application Framework document view base class.

Library: ilvappframe

The IlvDvDocViewInterface class is an interface for document views. It displays an attached document given by method getDocument(), and interacts with it using Application Framework interfaces.

Usually, the IlvDvDocViewInterface interface does not need to be implemented. The Application Framework package provides many gadget or view classes that implement this interface. It is recommended to inherit from these. In this case, the inherited class has to redefine the method initializeView() and track the user interactions in order to reflect them to the attached document.

However, for a specific use, it is possible to implement the IlvDvDocViewInterface interface. For that, the implementation must define and handle an IlvDvDocViewContext field member as follows:

 class MyDocumentView
 : public MyGadget, public IlvDvDocViewInterface {
  public:
    MyDocumentView(<list of parameters>) : _context(0) {}
    ~MyDocumentView() { if (_context) delete _context; }
  protected:
    IlvDvDocViewContext* _context;
    virtual IlvDvDocViewContext* createViewContext();
    virtual IlvDvDocViewContext* getViewContext() const;
 };

 IlvDvDocViewContext*
 MyDocumentView::createViewContext()
 {
    _context = new IlvDvDocViewContext(this);
    return _context;
 }

 IlvDvDocViewContext*
 MyDocumentView::getViewContext() const
 {
    return _context;
 }

Member Function Documentation

IlvDvDocument* IlvDvDocViewInterface::getDocument (  )  const

Gets the document associated with the view.

Returns:
The document associated with the view.
IlvDvApplication* IlvDvDocViewInterface::getDvApplication (  )  const

Gets the application in which the document view is displayed.

Returns:
The application in which the document view is displayed.
virtual IlvAbstractView* IlvDvDocViewInterface::getDvView (  )  [virtual]

Gets the IlvAbstractView of the document view.

Must be redefined by the class that implements the interface if the class inherits from the IlvAbstractView class. In this case, the redefined method must only return this object. For example, the IlvDvView class redefines the method to return (IlvView*)this object. By default, the method returns 0.

Returns:
The abstract view of the document view.

Reimplemented in IlvDvFormView, and IlvDvView.

virtual IlvGraphic* IlvDvDocViewInterface::getGraphic (  )  [virtual]

Gets the graphic object of the document view.

Must be redefined by the class that implements the interface if the class inherits from the IlvGraphic class. In this case, the redefined method only returns this object. For example, the IlvDvTextView class redefines this method to return (IlvText*)this object. By default, the method returns 0.

Returns:
The graphic object of the document view.

Reimplemented in IlvDvFormView, IlvDvTextView, IlvDvListView, IlvDvTreeView, IlvDvMatrixView, IlvDvSheetView, and IlvDvHierarchicalSheetView.

IlvDvViewContainerInterface* IlvDvDocViewInterface::getViewContainer (  )  const

Gets the document view container that owns the view.

Returns:
The document view container that owns the view.
virtual void IlvDvDocViewInterface::initializeView (  )  [virtual]

Initializes the document view.

Called by the document associated with the view to initialize its contents. Typically, gadget classes that implement the IlvDvDocViewInterface interface initialize the gadget using the associated document data.

Reimplemented in IlvDvFormView, IlvDvGrapherView, IlvDvManagerView, IlvDvProjectView, and IlvDvTextView.

virtual void IlvDvDocViewInterface::serialize ( IlvDvStream stream  )  [virtual]

Serializes the object in the stream stream.
Typically, the body of the method has the following form:
.

 void
 MyClass::serialize(IlvDvStream& stream) {
     Superclass::serialize(stream);
        if (stream.isSaving()) {
            // Here, write your persistent data
        } else {
            // Here, read data from stream
        }
 }

There are two ways to load and save data.
One way is to use istream or ostream objects given by methods istream* getInStream() const and ostream* getOutStream() const from the IlvDvStream class directly.
The other way, which is usually easier, is to use specific serialization methods provided by the IlvDvStream class.
This class provides serialization operators for basic types (IlInt, IlBoolean, and so on), and provides methods that make it easy to save a string, a bitmap, an IlvDvSerializable object, and an array of IlvDvSerializable objects.

Reimplemented from IlvDvSerializable.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.