// ==================================================
// Copyright 2013.
// Siemens Product Lifecycle Management Software Inc.
// All Rights Reserved.
// ==================================================

/**
    @file WorkspacePreferencesServices.hxx
    Provides easy access to some Teamcenter generic preferences
*/

/*  */

/**
    @brief A services class useful to retrieve and set values for some Workspace-centered preferences.
*/

#ifndef TEAMCENTER_TCCORE_WORKSPACE_PREFERENCES_SERVICES_HXX
#define TEAMCENTER_TCCORE_WORKSPACE_PREFERENCES_SERVICES_HXX

#include <base_utils/StatusT.hxx>

#include <tccore/libtccore_exports.h>
namespace Teamcenter
{
namespace TCCORE
{
class TCCORE_API WorkspacePreferencesServices
{
public :
    /** 
        Enumeration to define the acceptable values of the "WsoFolderSavePref" preference.
        <br>This preference defines when changes are to be saved automatically.
    */
    enum FolderSave {
        FolderSave_Unknown = 0,     /**< The preference value is not set properly. */
        FolderSave_SaveEach,        /**< The save happens on every change. */
        FolderSave_SaveOnClose,     /**< Automatically saves on close. */
        FolderSave_PromptOnClose    /**< Prompts the user on close, if the changes should be saved. */
    };
    /**
       Retrieves the value of the "WsoFolderSavePref" preference, which defines when changes are saved.
       @returns The #FolderSaveOption enumeration corresponding to the preference value.
    */
    static FolderSave getFolderSaveValue();
    /**
       Sets the value of the "WsoFolderSavePref" preference, which defines when changes are saved.
       @param[in] preferenceValue The #FolderSaveOption enumeration corresponding to the desired preference value.
       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setFolderSaveValue(FolderSave preferenceValue);


    /** 
        Enumeration to define the acceptable values of the "WsoInsertSelectionsPref" preference.
        <br>This preference defines which folders should have a reference to newly created objects, when a folder has been selected.
    */
    enum FolderReferencerWithSelection
    {
        ReferencerWith_Unknown = 0,         /**< The preference value is not set properly. */
        ReferencerWith_AllSelectedFolders,  /**< The referencers are all selected folders. */
        ReferencerWith_FirstSelectedFolder, /**< The referencer is only the first selected folder. */
        ReferencerWith_NewstuffFolder,      /**< The referencer is only the Newstuff folder. */
        ReferencerWith_NoFolder             /**< The object has no referencer. It is only placed into the database. */
    };
    /**
       Retrieves the value of the "WsoInsertSelectionsPref" preference, which defines what folders should have a 
       reference to newly created objects when a folder has been selected.
       @returns The #FolderReferencerOption enumeration corresponding to the preference value.
    */
    static FolderReferencerWithSelection getFolderReferencerWithSelectionValue();
    /**
       Sets the value of the "WsoInsertSelectionsPref" preference, which defines what folders should have a 
       reference to newly created objects when a folder has been selected.
       @param[in] preferenceValue The #FolderReferencerOption enumeration corresponding to the desired preference value.
       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setFolderReferencerWithSelectionValue(FolderReferencerWithSelection preferenceValue);


    /** 
        Enumeration to define the acceptable values of the "WsoInsertNoSelectionsPref" preference.
        <br>This preference defines which folders should have a reference to newly created objects, when no folder has been selected.
    */
    enum FolderReferencerWithoutSelection
    {
        ReferencerWithout_Unknown = 0,         /**< The preference value is not set properly. */
        ReferencerWithout_NewstuffFolder,      /**< The referencer is only the Newstuff folder. */
        ReferencerWithout_RootFolder,          /**< The referencer is only the root folder. */
        ReferencerWithout_NoFolder             /**< The object has no referencer. It is only placed into the database. */
    };
    /**
       Retrieves the value of the "WsoInsertNoSelectionsPref" preference, which defines what folders should have a 
       reference to newly created objects when no folder has been selected.
       @returns The #FolderReferencerOption enumeration corresponding to the preference value.
    */
    static FolderReferencerWithoutSelection getFolderReferencerWithoutSelectionValue();
    /**
       Sets the value of the "WsoInsertNoSelectionsPref" preference, which defines what folders should have a 
       reference to newly created objects when no folder has been selected.
       @param[in] preferenceValue The #FolderReferencerWithoutSelectionOption enumeration corresponding to the desired preference value.
       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setFolderReferencerWithoutSelectionValue(FolderReferencerWithoutSelection preferenceValue);


    /**
       Retrieves the value of the "OpenAfterCreatePref" preference, which indicates if objects have to be opened
       automatically after  creation. 
       @returns The preference value
    */
    static bool getOpenAfterCreateValue();
    /**
       Sets the value of the "OpenAfterCreatePref" preference, which indicates if objects have to be opened
       automatically after  creation. 
       @param[in] openAfterCreate The desired preference value.
       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setOpenAfterCreateValue( bool openAfterCreate );


    /**
       Sets the value of the "TC_check_out_dir" preference, which defines the operating system directory where Dataset files
       are to be when checking out a Dataset, if the preference managed by the APIs #getExportOnCheckOutDirectoryValue and 
       #setExportOnCheckOutDirectoryValue is activated.

       @returns The preference value. If it is not set, a 0 pointer is returned. <br>The returned pointer needs to be deallocated sing the MEM_free API.
    */
    static char* getExportOnCheckOutDirectoryValue ();
    /**
       Sets the value of the "TC_check_out_dir" preference, which defines the operating system directory where Dataset files
       are to be when checking out a Dataset, if the preference managed by the APIs #getExportOnCheckOutDirectoryValue and 
       #setExportOnCheckOutDirectoryValue is activated.

       @param[in] exportOnCheckOutDirectory The desired preference value.

       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setExportOnCheckOutDirectoryValue( const char* exportOnCheckOutDirectory );


    /**
       Retrieves the value of the "TC_checkout_and_export" preference, which indicates if Dataset files 
       are to be exported to a directory of the operating system when checking out a Dataset.
       <br>The counterpart preference is "TC_remove_file_on_check_in", which can be administered through the APIs 
       #getRemoveFilesOnCheckInValue and #setRemoveFilesOnCheckInValue.

       @returns The preference value
    */
    static bool getExportFilesOnCheckOutValue ();
    /**
       Sets the value of the "TC_checkout_and_export" preference, which indicates if Dataset files are to be
       exported to a directory of the operating system when checking out a Dataset.
       <br>The counterpart preference is "TC_remove_file_on_check_in", which can be administered through the APIs 
       #getRemoveFilesOnCheckInValue and #setRemoveFilesOnCheckInValue.

       @param[in] exportOnCheckOut The desired preference value.

       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setExportFilesOnCheckOutValue( bool exportOnCheckOut );


    /**
       Retrieves the value of the "TC_remove_file_on_check_in" preference, which indicates if Dataset files, which would 
       have been exported in an operating system directory on check-out, are to be removed on check-in or when the check-out
       is being cancelled.
       <br>The counterpart preference is "TC_remove_file_on_check_in", which can be administered through the APIs 
       #getExportFilesOnCheckOutValue and #setExportFilesOnCheckOutValue.

       @returns The preference value
    */
    static bool getRemoveFilesOnCheckInValue ();
    /**
       Sets the value of the "TC_remove_file_on_check_in" preference, which indicates if Dataset files, which would 
       have been exported in an operating system directory on check-out, are to be removed on check-in or when the 
       check-out is being cancelled.
       <br>The counterpart preference is "TC_remove_file_on_check_in", which can be administered through the APIs 
       #getExportFilesOnCheckOutValue and #setExportFilesOnCheckOutValue.

       @param[in] removeOnCheckIn The desired preference value.

       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setRemoveFilesOnCheckInValue (bool removeOnCheckIn);


    /**
       Retrieves the value of the "TC_display_real_prop_names" preference, which indicates if real property names are to be displayed. 
       @returns The preference value.
    */
    static bool getDisplayRealPropNamesValue();
    /**
       Sets the value of the "TC_display_real_prop_names" preference, which indicates if real property names are to be displayed. 
       @param[in] realPropertyNames The desired preference value.
       @returns A #status_t instance that indicates if the change was successful.
    */
    static status_t setDisplayRealPropNamesValue( bool realPropertyNames );
    
private:
    WorkspacePreferencesServices();
    WorkspacePreferencesServices(const WorkspacePreferencesServices&);
    WorkspacePreferencesServices& operator = (const WorkspacePreferencesServices&);
    virtual ~WorkspacePreferencesServices();
};
}
}
#include <tccore/libtccore_undef.h>
#endif
