Home · All Classes · Main Classes · Deprecated
Public Member Functions | Static Public Member Functions | Properties

MDialogModel Class Reference

Inheritance diagram for MDialogModel:
Inheritance graph
[legend]
Collaboration diagram for MDialogModel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

QGraphicsWidgetcentralWidget ()
void addButton (MButtonModel *button)
MButtonModeladdButton (M::StandardButton button)
void removeButton (MButtonModel *button)
MButtonModelbutton (M::StandardButton which)
MButtonModelbutton (int index)
M::StandardButton standardButton (const MButtonModel *button) const

Static Public Member Functions

static M::ButtonRole roleFor (M::StandardButton button)

Properties

int resultCode
bool closeButtonVisible
bool buttonBoxVisible
bool titleBarVisible
QString title
bool system
bool modal
bool systemModal
bool alwaysPannable
MPannableWidget::PanningPolicy contentsVerticalPanningPolicy
bool progressIndicatorVisible
MDialogButtonsList buttons

Detailed Description

Definition at line 32 of file corelib/widgets/mdialogmodel.h.


Member Function Documentation

void MDialogModel::addButton ( MButtonModel button  ) 

Adds a given button to the button box.

Nothing happens if the button was already added, otherwise its reference count is increased.

Parameters:
button A button

Definition at line 212 of file mdialogmodel.cpp.

{
    MDialogButtonsList &list = _buttons();

    if (list.indexOf(button) == -1) {
        list.append(button);
        button->increaseReferenceCount();
        memberModified(Buttons);
    }
}

Here is the call graph for this function:

MButtonModel * MDialogModel::addButton ( M::StandardButton  button  ) 

Creates a standard button specified by the button value.

The standard button has a predefined caption.

Returns a pointer to the newly created button. If button was already added, his model is returned instead and no new button is created.

MDialogModel holds ownership over the created button.

See also:
M::StandardButton, button(M::StandardButton which)

Definition at line 223 of file mdialogmodel.cpp.

{
    MButtonModel *buttonModel = 0;

    if (buttonType != M::NoStandardButton) {
        buttonModel = button(buttonType);

        if (!buttonModel) {
            buttonModel = createStandardButton(buttonType);
            buttonModel->setRole(roleFor(buttonType));
            addButton(buttonModel);
        }
    }

    return buttonModel;
}

Here is the call graph for this function:

MButtonModel * MDialogModel::button ( M::StandardButton  which  ) 

Returns a pointer to the standard button specified by which.

Returns a null pointer if there is no given standard button in the button box.

Changing the properties of the returned button can make it not be considered as a standard button anymore by the dialog.

Definition at line 251 of file mdialogmodel.cpp.

{
    MDialogButtonsList &list = _buttons();
    MButtonModel *buttonModel = 0;
    int i = 0;

    const int listSize = list.size();
    while (buttonModel == 0 && i < listSize) {
        if (standardButton(list[i]) == which) {
            buttonModel = list[i];
        } else {
            ++i;
        }
    }

    return buttonModel;
}

Here is the call graph for this function:

MButtonModel * MDialogModel::button ( int  index  ) 

Returns a non-const pointer to the button at the given index.

index is relative to buttons property.

Definition at line 269 of file mdialogmodel.cpp.

{
    MDialogButtonsList &list = _buttons();
    if (index >= 0 && index < list.size()) {
        return list[index];
    } else {
        return 0;
    }
}

Here is the call graph for this function:

MDialogModel::centralWidget (  ) 

Central widget for the dialog.

Non-const getter for centralWidget property. Used by view classes to add the central widget to their internal layouts.

Definition at line 206 of file mdialogmodel.cpp.

{
    const MDialogModel *constThis = this;
    return const_cast<QGraphicsWidget *>(constThis->centralWidget());
}

Here is the call graph for this function:

void MDialogModel::removeButton ( MButtonModel button  ) 

Removes button from the dialog without deleting it.

The ownership of button is passed on to the caller.

See also:
addButton()

Definition at line 240 of file mdialogmodel.cpp.

{
    Q_ASSERT(button);
    MDialogButtonsList &list = _buttons();

    if (list.removeOne(button)) {
        memberModified(Buttons);
        button->decreaseReferenceCount();
    }
}

Here is the call graph for this function:

M::ButtonRole MDialogModel::roleFor ( M::StandardButton  button  )  [static]

Maps M::StandardButton enum values to corresponding M::ButtonRole.

See also:
button(M::StandardButton)

Definition at line 329 of file mdialogmodel.cpp.

{
    switch (button) {
    case M::OkButton:
    case M::SaveButton:
    case M::OpenButton:
    case M::SaveAllButton:
    case M::RetryButton:
    case M::IgnoreButton:
    case M::DoneButton:
        return M::AcceptRole;

    case M::CancelButton:
    case M::CloseButton:
    case M::AbortButton:
        return M::RejectRole;

    case M::DiscardButton:
        return M::DestructiveRole;

    case M::HelpButton:
        return M::HelpRole;

    case M::ApplyButton:
        return M::ApplyRole;

    case M::YesButton:
    case M::YesToAllButton:
        return M::YesRole;

    case M::NoButton:
    case M::NoToAllButton:
        return M::NoRole;

    case M::RestoreDefaultsButton:
    case M::ResetButton:
        return M::ResetRole;

    default:
        return M::InvalidRole;
    }
}

M::StandardButton MDialogModel::standardButton ( const MButtonModel button  )  const

Returns the standard button enum value corresponding to the given button, or NoButton if the given button isn't a standard button.

See also:
button(M::StandardButton)

Definition at line 279 of file mdialogmodel.cpp.

{
    M::StandardButton result = M::NoStandardButton;

    if (button == NULL)
        return result;

    if (button->objectName() == MDialogModelPrivate::ButtonNameOk) {
        result = M::OkButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameOpen) {
        result = M::OpenButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameSave) {
        result = M::SaveButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameCancel) {
        result = M::CancelButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameClose) {
        result = M::CloseButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameDiscard) {
        result = M::DiscardButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameApply) {
        result = M::ApplyButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameReset) {
        result = M::ResetButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameRestoreDefaults) {
        result = M::RestoreDefaultsButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameHelp) {
        result = M::HelpButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameSaveAll) {
        result = M::SaveAllButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameYes) {
        result = M::YesButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameYesToAll) {
        result = M::YesToAllButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameNo) {
        result = M::NoButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameNoToAll) {
        result = M::NoToAllButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameAbort) {
        result = M::AbortButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameRetry) {
        result = M::RetryButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameIgnore) {
        result = M::IgnoreButton;
    } else if (button->objectName() == MDialogModelPrivate::ButtonNameDone) {
        result = M::DoneButton;
    }

    return result;
}


Property Documentation

bool MDialogModel::alwaysPannable [read, write]

Definition at line 62 of file corelib/widgets/mdialogmodel.h.

bool MDialogModel::buttonBoxVisible [read, write]

Definition at line 49 of file corelib/widgets/mdialogmodel.h.

MDialogModel::buttons [read, write]

List of buttons int the button box.

Definition at line 89 of file corelib/widgets/mdialogmodel.h.

MDialogModel::closeButtonVisible [read, write]
Deprecated:
Use MDialogStyle::hasCloseButton instead. OBS: Style properties are set in CSS files and consumed by the assigned view.

Definition at line 48 of file corelib/widgets/mdialogmodel.h.

MDialogModel::contentsVerticalPanningPolicy [read, write]

Vertical panning policy for MDialog's contents.

See also:
MPannableWidget::PanningPolicy

Definition at line 70 of file corelib/widgets/mdialogmodel.h.

bool MDialogModel::modal [read, write]

Definition at line 60 of file corelib/widgets/mdialogmodel.h.

MDialogModel::progressIndicatorVisible [read, write]

Whether the progress indicator on the title bar is visible.

Definition at line 77 of file corelib/widgets/mdialogmodel.h.

int MDialogModel::resultCode [read, write]

Definition at line 40 of file corelib/widgets/mdialogmodel.h.

bool MDialogModel::system [read, write]

Definition at line 59 of file corelib/widgets/mdialogmodel.h.

bool MDialogModel::systemModal [read, write]

Definition at line 61 of file corelib/widgets/mdialogmodel.h.

QString MDialogModel::title [read, write]

Definition at line 58 of file corelib/widgets/mdialogmodel.h.

MDialogModel::titleBarVisible [read, write]
Deprecated:
Use MDialogStyle::hasTitleBar instead. OBS: Style properties are set in CSS files and consumed by the assigned view.

Definition at line 57 of file corelib/widgets/mdialogmodel.h.


Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:24 (PDT)
Doxygen 1.7.1
MeeGo Touch