Home|Download|Buy online|Affiliates|Search|Feedback|Site Map|ReviewsUse our online RSS & XML news feeds to get the latest news about our products delivered to your desktop... RSS feed    04.02.2012
Home»BestView preview library»SDK
Find out more how to use BestView...
Declarations

Declarations

Macros

The macro BESTVIEWAPI is declared as:

    #define BESTVIEWAPI(T) extern "C" T _cdecl

Windows classes

There are two windows classes declared:

  • COREPREVIEW_CLASSNAME - the windows class name is BESTVIEWCORE. This is the name of the window class of the core preview window
  • FRAMECOREPREVIEW_CLASSNAME - the windows class name is BESTVIEWFRAMECORE. This is the name of the window class of the frame preview window

Broadcast messages

Next broadcast messages are registered during the bvInit function call:

  • BESTVIEW_FRAMELANGCHANGED_MSG_BROADCAST - the message is sent when language has changed
  • BESTVIEW_SCALEFACTORCHANGED_MSG_BROADCAST - the message is sent when the user finishes screen calibration
  • BESTVIEW_BVTERM_MSG_BROADCAST - the message is sent after bvTerm function call

Structures

LANGUAGE_PAIR

The structure is used to describe languages in the resource file.

struct LANGUAGE_PAIR
    {
    LPCTSTR pszLanguageID;   // Language ID from the resource file
    LPCTSTR pszLanguageName; // The name of the language
    };      
    

COREPREVIEW_PAGESIZE

The structure is used to describe users's paper size.

struct COREPREVIEW_PAGESIZE
    {
    DWORD dwSize;               // size of this structure
    DWORD dwPageWidth;          // width of the paper, in the 0.01 millimiters
    DWORD dwPageHeight;         // height of the paper, in the 0.01 millimiters
    DWORD dwLeftOffset;         // offset from the left edge of the paper,
                                // in the 0.01 millimiters
    DWORD dwTopOffset;          // offset from the top edge of the paper,
                                // in the 0.01 millimiters
    DWORD dwWidth;              // width of the printable area,
                                // in the 0.01 millimiters
    DWORD dwHeight;             // height of of the printable area,
                                // in the 0.01 millimiters
    };           
        

COREPREVIEW_COORDINATESPACE

The structure is intended for internal use only.

struct COREPREVIEW_COORDINATESPACE
    {
    HDC dc;                     // handle of the device context to be set
    LONG ViewportExtWidth;      // width of viewport
    LONG ViewportExtHeight;     // height of viewport
    LONG ViewportOrgXOffset;    // offset from the left edge of the viewport
    LONG ViewportOrgYOffset;    // offset from the top edge of the viewport
    };   
        

PAPERSIZETYPE

The structure describes paper sizes.

struct PAPERSIZETYPE
    {
    DWORD        dmPaperSize; // see DEVMODE dmPaperSize available values.
                              // Also please read comments for bvGetPaperTypeByItsSizes
                              // function
    LPCTSTR      pszName; // name of the paper
    LONG         Width; // width of the paper, in 0.001 mm
    LONG         Height; // width of the paper, in 0.001 mm
    };
        

COREPREVIEW_CALLBACK

The structure is used to route messages between user's drawing class and preview window.

   

 
    struct
    COREPREVIEW_CALLBACK
    {
    DWORD              dwSize; // size of this structure 
    LPVOID         lpUserData; // pointer to user data  
    COREPREVIEW_PAGESIZE CorePreviewPageSize; // the size of page 
    LONG lNumPages;  // the number of pages 
    LONG lInitialPreviewMode; // the initial preview mode.
                               // See COREPREVIEW_MODE enumeration  
    float fScaleFactor; // the scale factor for PREVIEW_MODE_CUSTOM mode 
    void (__stdcall* pfnDrawPage)
    (const COREPREVIEW_CALLBACK *,HDC,DWORD,DWORD,LPRECT);  // 
            // pointer to callback function, 
            // see CorePreviewCallbackWrapper
            //  for details
     void (__stdcall* pfnMouseMove)
     (const COREPREVIEW_CALLBACK *,LONG,LONG,LONG,LONG); //
     // pointer to callback function, see CorePreviewCallbackWrapper 
     // for  details   
     
     void (__stdcall* pfnPreviewModeChanged)
     (const COREPREVIEW_CALLBACK *,LONG,float); //
     //  pointer to callback function, see CorePreviewCallbackWrapper
     // for details
    void (__stdcall*  pfnForwardMessage)
    (const COREPREVIEW_CALLBACK*,HWND,UINT,WPARAM,LPARAM); //
    // pointer to callback function , see CorePreviewCallbackWrapper 
    //for details
    LONG (__stdcall* pfnWindowIsAboutToClose)(const COREPREVIEW_CALLBACK *); //
     //  pointer to callback function, see CorePreviewCallbackWrapper
     // for details
    void (__stdcall* pfnMsgNcDestroy)(const COREPREVIEW_CALLBACK *,HWND); //
     //  pointer to callback function, see CorePreviewCallbackWrapper
     // for details
    LPCTSTR (__stdcall* pfnGetPrintDocName)(const COREPREVIEW_CALLBACK *); //
     //  pointer to callback function, see CorePreviewCallbackWrapper
     // for details
    void (__stdcall *pfnStartPrint)(const COREPREVIEW_CALLBACK *,HDC,LPCTSTR); //
     //  pointer to callback function, see CorePreviewCallbackWrapper
     // for details
    void (__stdcall *pfnEndPrint)(const COREPREVIEW_CALLBACK * ); //
     //  pointer to callback function, see CorePreviewCallbackWrapper
     // for details
    LONG (__stdcall *pfnBeforePrint)(const COREPREVIEW_CALLBACK * ,HWND,LPCTSTR,PDEVMODE); //
     //  pointer to callback function, see CorePreviewCallbackWrapper
     // for details    
    
    };
    

TYPOGRAPHICTEXT

The structure is used to describe advanced options for drawing text with bvDrawTypographicText function.

       
struct TYPOGRAPHICTEXT
    {
    LONG  lUseKerningPairs;    // if not zero then kerning pairs will be used
    LONG  lTrimLeadingSpaces;  // if not zero then the leading spaces
                               // in each line will be cut
    float fFirstLineOffset;    // This the left offset of the first line,
                               // "break line" indent, in logical units.
    float fLineSpacingFactor;  // This is the factor of 
                               // the interval between lines.
    float fHScalingFactor;     // The factor of distance between letters.
    float fPreParagraphIndent; // The indent before each paragraph.
    float PostParagraphIndent; // The indent after each paragraph.
    };  
    

Enumerations

COREPREVIEW_MODE

The enumeration describes scale modes of the preview window:

enum COREPREVIEW_MODE
    {
    PREVIEW_MODE_WIDTH=0x01,
    PREVIEW_MODE_HEIGHT=0x02,
    PREVIEW_MODE_100_PERCENT=0x03,
    PREVIEW_MODE_CUSTOM=0x04
    };      
    

Messages

The enumeration describes messages are processed by preview windows:

enum COREPREVIEW_MESSAGES
{
COREPREVIEW_BASE=WM_USER+1,
COREPREVIEW_INIT=COREPREVIEW_BASE+1,                 // wParam - 0,
                                                     // lParam - PCOREPREVIEW_CALLBACK
COREPREVIEW_SETMODE=COREPREVIEW_BASE+2,              // wParam - ptr to float - fZoom,
                                                     // lParam - COREPREVIEW_MODE
COREPREVIEW_GETMODE=COREPREVIEW_BASE+3,              // wParam - ptr to float - fZoom,
                                                     // lParam - ptr to LONG,
                                                     // COREPREVIEW_MODE
COREPREVIEW_PAGEDIRTY=COREPREVIEW_BASE+4,            // wParam - 0, lParam - page number
COREPREVIEW_SHOWMARGINS=COREPREVIEW_BASE+5,          // wParam - 0,
                                                     // lParam - true - show,
                                                     // false - not show
COREPREVIEW_AREMARGINSSHOWN=      COREPREVIEW_BASE+6,// wParam - 0, 
                                                     // lParam - ptr to LONG
COREPREVIEW_SETNUMPAGESPERWIDTH=  COREPREVIEW_BASE+7,// wParam - 0, 
                                                     // lParam - pages
COREPREVIEW_GETNUMPAGESPERWIDTH=  COREPREVIEW_BASE+8,// wParam - 0,
                                                     // lParam - ptr to LONG
COREPREVIEW_SETNUMPAGESPERHEIGHT= COREPREVIEW_BASE+9,// wParam - 0,
                                                     // lParam - pages
COREPREVIEW_GETNUMPAGESPERHEIGHT=COREPREVIEW_BASE+10,// wParam - 0,
                                                     // lParam - ptr to LONG
COREPREVIEW_SETHDCCOORINATESPACE=COREPREVIEW_BASE+11 // wParam - 0,
                                            // lParam - PCOREPREVIEW_COORDINATESPACE
    };      
    
Message WPARAM LPARAM Description
COREPREVIEW_BASE This message isn't processed by preview window
COREPREVIEW_INIT 0 a pointer to COREPREVIEW_CALLBACK structure The message is used to initialize preview window
COREPREVIEW_SETMODE a pointer to a float variable with the scale factor. Makes sense only in case of PREVIEW_MODE_CUSTOM mode. value of COREPREVIEW_MODE enumeration The message is used to set scale mode of the preview window. In case PREVIEW_MODE_CUSTOM is sent, the wParam must be a pointer to a float variable with the scale factor. The scale factor can be from 0.1 (10%) to 10.0 (1000%)
COREPREVIEW_GETMODE a pointer to a float variable where the current scale factor will be stored. a pointer to a LONG variable where the current scale mode (as COREPREVIEW_MODE enum) will be stored. This message is used to retrieve current scale mode.
COREPREVIEW_PAGEDIRTY 0 the number of the page which is needed to be redrawn. First page has number zero. The message is used to inform the preview window that the content of a page is invalid and the page is needed to be redrawn.
COREPREVIEW_SHOWMARGINS 0 1 - page margins will be shown, 0 -no The message sets whether the page margings will be shown
COREPREVIEW_AREMARGINSSHOWN 0 a pointer to a LONG variable where a boolean value will be stored. 1 means that margins are shown, 0 - no. Using the message the user can get information whether page margins are shown
COREPREVIEW_SETNUMPAGESPERWIDTH 0 the number of pages per preview window's width The message sets the number of pages to fit in the preview windows's width
COREPREVIEW_GETNUMPAGESPERWIDTH 0 a pointer to a LONG variable where the number of pages per width will be stored. The message is used to retrieve the number of pages per width.
COREPREVIEW_SETNUMPAGESPERHEIGHT 0 the number of pages per preview window's height The message sets the number of pages to fit in the preview windows's height
COREPREVIEW_GETNUMPAGESPERHEIGHT 0 a pointer to a LONG variable where the number of pages per height will be stored. The message is used to retrieve the number of pages per height.
COREPREVIEW_SETHDCCOORINATESPACE 0 a pointer to COREPREVIEW_COORDINATESPACE structure This function is for internal use only.
Valid HTML 4.01 Transitional© PVL team, 2004-2012, all rights reserved. This Web site and its entire contents are for personal use only and may not be copied, reproduced, modified, published or distributed in any way,without PVL team's prior written permission.