8 Sample Applications

This chapter describes the samples applications shipped with the Viewer. Each of the sample applications included in this SDK is designed to highlight a specific aspect of the technology's functionality. We ship built versions of these sample applications. The compiled executables should be in the root directory where the product is installed.

The following copyright applies to all sample applications shipped with this product:

Copyright © Oracle 1993, 2016

All rights reserved.

You have a royalty-free right to use, modify, reproduce and distribute the Sample Applications (and/or any modified version) in any way you find useful, provided that you agree that Oracle has no warranty obligations or liability for any Sample Application files.

This chapter includes the following sections:

8.1 Building the Samples on a Windows System

Microsoft Visual Studio project files are provided for building each of the sample applications. For 32-bit versions of Windows, versions of the project files are provided for Visual Studio 6 (.dsp files) and Visual Studio 2005 (.vcproj files).

Note:

Because .vcproj files may not pick up the right compiler on their own, you need to make sure that you are building with the Win64 configuration in Visual Studio 2005. For 64-bit versions of Windows, only the Visual Studio 2005 versions are available.

The project files for the sample applications can be found in the \sdk\samplecode\win subdirectory of the Oracle Outside In SDK.

8.2 Building the Samples on a UNIX System

See the following sections for specific information about building the sample applications on your flavor of UNIX:

8.3 An Overview of the Sample Applications

This section provides an overview of the sample applications provided with this product. Please note that not all of the sample applications are provided for both the Windows and UNIX platforms. See the heading of each application's subsection for clarification.

This section includes the following sample applications:

8.3.1 annoex (Windows Only)

This sample demonstrates the view window's advanced annotation and positioning capabilities. Messages used include:

  • SCCVW_ADDANNOTATION

  • SCCVW_ANNOTATIONEVENT

  • SCCVW_BAILOUT

  • SCCVW_CLEARANNOTATIONS

  • SCCVW_COMPPOSITIONS

  • SCCVW_COPYTOCLIP

  • SCCVW_DISPLAYPOSITION

  • SCCVW_FINDANNOTATION

  • SCCVW_FINDPOSITION

  • SCCVW_GETANNOTATIONDATA

  • SCCVW_GETFILEINFO

  • SCCVW_GETRAWTEXT

  • SCCVW_HILITESTYLE

  • SCCVW_MAPPOSITION

  • SCCVW_SETSELECTION

It also demonstrates the following options:

  • SCCID_SYSTEMFLAGS

  • SCCID_FALLBACKFORMAT

8.3.2 annotate

This sample is essentially the same as SIMPLE except that it uses the Oracle Outside In's Raw Text and Annotation ability to annotate all occurrences of the text the in the document. This sample demonstrates the following messages:

  • SCCVW_ADDANNOTATION

  • SCCVW_ANNOTATIONEVENT

  • SCCVW_GOTOANNOTATION

  • SCCVW_CLOSEFILE

  • SCCVW_COPYTOCLIP

  • SCCVW_FILECHANGE

  • SCCVW_GETFILEINFO

  • SCCVW_PRINT

  • SCCVW_VIEWFILE

It also demonstrates the SCCID_SYSTEMFLAGS option. Please note that the compiled Linux version of annotate is compiled on Red Hat Linux and as such may not work perfectly on the SuSE Linux platform without including SuSE's LessTif libraries or recompiling.

Messages used include:

  • SCCVW_ADDANNOTATION

  • SCCVW_CLEARANNOTATIONS

  • SCCVW_COMPPOSITIONS

  • SCCVW_DISPLAYPOSITION

  • SCCVW_FINDANNOTATION

  • SCCVW_FINDPOSITION

  • SCCVW_GETFILEINFO

  • SCCVW_GETRAWTEXT

  • SCCVW_GOTOANNOTATION

  • SCCVW_MAPPOSITION

  • SCCVW_SETSELECTION

  • SCCVW_VIEWFILE

8.3.3 apitest (UNIX Only)

This sample provides a comprehensive test of the API functionality. Messages used include:

  • SCCVW_ADDANNOTATION

  • SCCVW_CLEARANNOTATIONS

  • SCCVW_CLOSEFILE

  • SCCVW_COMPPOSITIONS

  • SCCVW_COPYTOCLIP

  • SCCVW_DISPLAYPOSITION

  • SCCVW_FINDANNOTATION

  • SCCVW_FINDPOSITION

  • SCCVW_GETFILEINFO

  • SCCVW_GETOPTION

  • SCCVW_GETRAWTEXT

  • SCCVW_GETTREECOUNT

  • SCCVW_GETTREENODE

  • SCCVW_IDLE

  • SCCVW_INFOMESSAGE

  • SCCVW_MAPPOSITION

  • SCCVW_SAVETREENODE

  • SCCVW_SEARCH

  • SCCVW_SEARCHNEXT

  • SCCVW_SELECTALL

  • SCCVW_SETOPTION

  • SCCVW_SETSELECTION

  • SCCVW_VIEWFILE

  • SCCVW_VIEWTHISFILE

The application also demonstrates the following options:

  • SCCID_ARCOUTPUTPATH

  • SCCID_ARCRENAME

  • SCCID_DAYNAMES

  • SCCID_DIALOGFLAGS

  • SCCID_DISPLAYFONTALIAS

  • SCCID_FIFLAGS

  • SCCID_FONTSCALINGFACTOR

  • SCCID_INTLFLAGS

  • SCCID_MAINTAINZOOM

  • SCCID_MONTHNAMES

  • SCCID_NUMBERFORMAT

  • SCCID_PRINTFONTALIAS

  • SCCID_SYSTEMFLAGS

  • SCCID_TEMPDIR

  • SCCID_UNMAPPABLECHAR

  • SCCID_VECPRINTBACKGROUND

  • SCCID_VECSHOWBACKGROUND

8.3.4 drawpage

This application demonstrates the DrawPage feature that can be used to display thumbnails and write pages to bitmaps. Messages used include:

  • SCCVW_CLOSEFILE

  • SCCVW_COPYTOCLIP

  • SCCVW_DEINITDRAWPAGE

  • SCCVW_DRAWPAGE

  • SCCVW_FILECHANGE

  • SCCVW_GETDISPLAYINFO

  • SCCVW_GETDRAWPAGEINFO

  • SCCVW_GETFILEINFO

  • SCCVW_INITDRAWPAGE

  • SCCVW_OPTIONCHANGE

  • SCCVW_VIEWFILE

It also demonstrates the SCCID_VECPRINTBACKGROUND option.

8.3.5 ExtractArchive

ExtractArchive demonstrates using the DATree API to extract all nodes in an archive.

The application is executed from the command line and takes two parameters, the name of the input file and the name of an output directory for the extracted files:

ExtractArchive input_file output_directory

8.3.6 mdiview (Windows Only)

This application shows how multiple view windows can be supported in an multiple document interface setting. Messages used include:

  • SCCVW_FINDPOSITION

  • SCCVW_GETIDEALWINDOWSIZE

  • SCCVW_GETTREENODE

  • SCCVW_MAPTREEPOSITION

  • SCCVW_SEARCHDIALOG

  • SCCVW_SEARCHNEXT

  • SCCVW_SELCHANGE

  • SCCVW_SELECTALL

  • SCCVW_SETOPTION

  • SCCVW_VIEWAS

  • SCCVW_VIEWTHISFILE

This sample also demonstrates the following options:

  • SCCID_ARCSAVEEVENT

  • SCCID_DIALOGFLAGS

8.3.7 mfcview (Windows Only)

This application shows a simple viewer implementation using Microsoft Foundation Class. Messages used include:

  • SCCVW_GETCLIPINFO

8.3.8 options (Windows Only)

This sample app demonstrates a broad set of messages, including the following:

  • SCCVW_DODIALOG

  • SCCVW_DOHELP

  • SCCVW_GETCURRENTPAGENUMBER

  • SCCVW_GETOPTION

  • SCCVW_HSCROLL

  • SCCVW_INFOMESSAGE

  • SCCVW_READAHEADDONE

  • SCCVW_SETOPTION

  • SCCVW_VSCROLL

  • SCCVW_VIEWTHISFILE

Additionally, the application demonstrates the following options:

  • SCCID_ARCOUTPUTPATH

  • SCCID_BMPZOOM

  • SCCID_DEFAULTPRINTMARGINS

  • SCCID_DISPLAYFONTALIAS

  • SCCID_FIFLAGS

  • SCCID_FILTERJPG

  • SCCID_FILTERLZW

  • SCCID_FONTSCALINGFACTOR

  • SCCID_HTML_COND_COMMENT_MODE

  • SCCID_MAILHEADERHIDDEN

  • SCCID_MAILHEADERVISIBLE

  • SCCID_MAINTAINZOOM

  • SCCID_PRINTFONTALIAS

  • SCCID_REORDERMETHOD

  • SCCID_RESOURCELIBRARYID

  • SCCID_SCROLLFLAGS

  • SCCID_SYSTEMFLAGS

  • SCCID_TEMPDIR

  • SCCID_UNMAPPABLECHAR

  • SCCID_VECZOOM

  • SCCID_WPDISPLAYMODE

8.3.9 print (Windows Only)

This application shows various print options. Messages used include:

  • SCCVW_GETFILEINFO

  • SCCVW_PRINT

  • SCCVW_PRINTEX

  • SCCVW_PRINTSETUP

This application also demonstrates the following options:

  • SCCID_WHATTOPRINT

  • SCCID_PRINTSTARTPAGE

  • SCCID_PRINTENDPAGE

  • SCCID_PRINTCOLLATE

  • SCCID_PRINTCOPIES

8.3.10 printd (UNIX Only)

This application code demonstrates how to implement printing in the Oracle Outside In Viewer using a dialog. This uses the API messages:

  • SCCVW_GETFILEINFO

  • SCCVW_GETOPTION

  • SCCVW_PRINT

  • SCCVW_PRINTSETUP

  • SCCVW_SETOPTION

  • SCCVW_VIEWFILE

It also demonstrates the following options:

  • SCCID_BMPPRINTBORDER

  • SCCID_BMPPRINTASPECT

  • SCCID_VECPRINTBORDER

  • SCCID_VECPRINTASPECT

  • SCCID_SSPRINTGRIDLINES

  • SCCID_SSPRINTHEADINGS

  • SCCID_SSPRINTFITTOPAGE

  • SCCID_SSPRINTDIRECTION

  • SCCID_SSPRINTSCALEPERCENT

  • SCCID_SSPRINTSCALEXHIGH

  • SCCID_SSPRINTSCALEXWIDE

  • SCCID_DBPRINTGRIDLINES

  • SCCID_DBPRINTHEADINGS

  • SCCID_DBPRINTFITTOPAGE

  • SCCID_PRINTHEADER

  • SCCID_USEDOCPAGESETTINGS

  • SCCID_DEFAULTPRINTFONT

  • SCCID_PRINTHEADERFONT

  • SCCID_DEFAULTPRINTMARGINS

8.3.11 prints (UNIX Only)

This application code demonstrates how to implement printing in the Oracle Outside In Viewer. This uses the API messages:

  • SCCVW_GETFILEINFO

  • SCCVW_GETOPTION

  • SCCVW_PRINT

  • SCCVW_PRINTSETUP

  • SCCVW_SETOPTION

  • SCCVW_VIEWFILE

It also demonstrates the following options:

  • SCCID_BMPPRINTBORDER

  • SCCID_BMPPRINTASPECT

  • SCCID_VECPRINTBORDER

  • SCCID_VECPRINTASPECT

  • SCCID_SSPRINTGRIDLINES

  • SCCID_SSPRINTHEADINGS

  • SCCID_SSPRINTFITTOPAGE

  • SCCID_SSPRINTDIRECTION

  • SCCID_SSPRINTSCALEPERCENT

  • SCCID_SSPRINTSCALEXHIGH

  • SCCID_SSPRINTSCALEXWIDE

  • SCCID_DBPRINTGRIDLINES

  • SCCID_DBPRINTHEADINGS

  • SCCID_DBPRINTFITTOPAGE

  • SCCID_PRINTHEADER

  • SCCID_USEDOCPAGESETTINGS

  • SCCID_DEFAULTPRINTFONT

  • SCCID_PRINTHEADERFONT

  • SCCID_DEFAULTPRINTMARGINS

8.3.12 redirect

This sample is essentially the same as SIMPLE except that it redirects the Oracle Outside In input routines (Read, Seek, Tell, …) through its own routines. This sample uses the API messages SCCVW_VIEWFILE and SCCVW_GETFILEINFO.

8.3.13 search

This sample is essentially the same as SIMPLE except that it adds the ability to search for strings in the file being viewed. Messages used include:

  • SCCVW_GETFILEINFO

  • SCCVW_SEARCH

  • SCCVW_SEARCHNEXT

  • SCCVW_VIEWFILE

8.3.14 simple

This sample demonstrates the simplest implementation of the Viewer. It shows the basics of how to create a view window, view a file, print the viewed file and copy to the clipboard. Messages used include:

  • SCCVW_CLOSEFILE

  • SCCVW_COPYTOCLIP

  • SCCVW_FILECHANGE

  • SCCVW_GETFILEINFO

  • SCCVW_PRINT

  • SCCVW_VIEWFILE

8.3.15 welcome (Windows Only)

This application displays the welcome.doc file. Messages used include:

  • SCCVW_GETIDEALWINDOWSIZE

  • SCCVW_VIEWTHISFILE