Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CalculatorImpl Class Reference

#include </home/clem/local/src/opie/noncore/tools/calculator/calculatorimpl.h>

Inheritance diagram for CalculatorImpl:

Inheritance graph
[legend]
Collaboration diagram for CalculatorImpl:

Collaboration graph
[legend]
List of all members.

Public Slots

void command_buttons (int)
void enterNumber (int i)
void std_buttons (int)
void std_funcs (int)
void do_convert (int)
void function_button (int)

Public Member Functions

 CalculatorImpl (QWidget *parent=0, const char *name=0, WFlags f=0)

Static Public Member Functions

static QString appName ()

Protected Member Functions

virtual bool eventFilter (QObject *o, QEvent *e)

Private Member Functions

void clear ()
void reset_conv ()
void processStack (int op)
void execOp (Operation i)
double evalExpr (int op)
void display_pixmap_faces (void)

Private Attributes

QValueStack< OpoperationStack
int state
double acc
double num
double mem
int numDecimals
bool flPoint
int numOpenBraces
QLabel * memMark
QString fake
int current_mode
int max_mode
int conversion_mode_count
int last_conversion
QPushButton * func_buttons [func_button_count]
QButtonGroup bgr_function
QButtonGroup bgr_digits
QButtonGroup bgr_std
QButtonGroup bgr_command
QStringList faces
QStringList captions
double * entry_list
double * preoffset_list
double * postoffset_list
QPixmap xtopowerofy
QPixmap ythrootofx
QPixmap oneoverx

Static Private Attributes

static const int pre_conv_modes_count = 1
static const int post_conv_modes_count = 0
static const int func_button_count = 12
static const int changeable_func_button_count = 10

Constructor & Destructor Documentation

CalculatorImpl::CalculatorImpl QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0
 

Definition at line 107 of file calculatorimpl.cpp.

References QValueList< T >::append(), bgr_command, bgr_digits, bgr_function, bgr_std, captions, clear(), QFile::close(), command_buttons(), QString::contains(), conversion_mode_count, current_mode, display_pixmap_faces(), do_convert(), enterNumber(), entry_list, QTextStream::eof(), faces, FALSE, func_button_count, func_buttons, function_button(), IO_ReadOnly, IO_Translate, QValueList< T >::last(), last_conversion, max_mode, mem, memMark, odebug, oendl, QFile::open(), post_conv_modes_count, postoffset_list, pre_conv_modes_count, preoffset_list, qApp, QPEApplication::qpeDir(), QTextStream::readLine(), QString::remove(), std_buttons(), std_funcs(), QString::toDouble(), tr, TRUE, and Opie::MM::x.


Member Function Documentation

static QString CalculatorImpl::appName void   )  [inline, static]
 

Definition at line 77 of file calculatorimpl.h.

References QString::fromLatin1().

void CalculatorImpl::clear  )  [private]
 

Definition at line 417 of file calculatorimpl.cpp.

References acc, QValueList< T >::clear(), fake, FALSE, flPoint, QString::null, num, numDecimals, numOpenBraces, operationStack, reset_conv(), sStart, and state.

Referenced by CalculatorImpl(), command_buttons(), and function_button().

void CalculatorImpl::command_buttons int   )  [slot]
 

Definition at line 694 of file calculatorimpl.cpp.

References acc, clear(), fake, FALSE, flPoint, mem, memMark, QString::null, num, numDecimals, sError, sNewNumber, sStart, state, and TRUE.

Referenced by CalculatorImpl().

void CalculatorImpl::display_pixmap_faces void   )  [private]
 

Definition at line 403 of file calculatorimpl.cpp.

References func_buttons, oneoverx_xpm, xtopowerofy_xpm, and ythrootofx_xpm.

Referenced by CalculatorImpl(), and function_button().

void CalculatorImpl::do_convert int   )  [slot]
 

Definition at line 340 of file calculatorimpl.cpp.

References acc, changeable_func_button_count, current_mode, entry_list, func_button_count, last_conversion, max_mode, num, post_conv_modes_count, postoffset_list, pre_conv_modes_count, preoffset_list, sError, sNewNumber, and state.

Referenced by CalculatorImpl().

void CalculatorImpl::enterNumber int  i  )  [slot]
 

Definition at line 626 of file calculatorimpl.cpp.

References acc, QString::contains(), fake, QString::fill(), flPoint, QString::length(), QString::mid(), num, QString::number(), numDecimals, s, sError, sNewNumber, sStart, and state.

Referenced by CalculatorImpl(), and eventFilter().

double CalculatorImpl::evalExpr int  op  )  [private]
 

Definition at line 572 of file calculatorimpl.cpp.

References acc, num, oAdd, oChSign, oCos, oDiv, oDivX, oLn, oLog, oMult, oPercent, oRoot, oSin, oSub, oTan, oXsquared, qCos(), qSin(), qTan(), sError, sStart, and state.

Referenced by execOp(), and processStack().

bool CalculatorImpl::eventFilter QObject *  o,
QEvent *  e
[protected, virtual]
 

Definition at line 294 of file calculatorimpl.cpp.

References current_mode, enterNumber(), execOp(), Key_0, Key_9, KeyPress, oCloseBrace, oOpenBrace, oPercent, pre_conv_modes_count, sError, state, and std_buttons().

void CalculatorImpl::execOp Operation  i  )  [private]
 

Definition at line 466 of file calculatorimpl.cpp.

References evalExpr(), FALSE, flPoint, num, numDecimals, numOpenBraces, oAdd, oChSign, oCloseBrace, oCos, odebug, oDiv, oDivX, oendl, oLn, oLog, oMult, oOpenBrace, operationStack, oPercent, oPoint, oRoot, oSin, oSub, oSum, oTan, oXsquared, QValueStack< T >::pop(), processStack(), QValueStack< T >::push(), sError, sNewNumber, state, QValueStack< T >::top(), and TRUE.

Referenced by eventFilter(), std_buttons(), and std_funcs().

void CalculatorImpl::function_button int   )  [slot]
 

Definition at line 368 of file calculatorimpl.cpp.

References bgr_function, captions, changeable_func_button_count, clear(), current_mode, display_pixmap_faces(), faces, FALSE, func_button_count, func_buttons, last_conversion, max_mode, post_conv_modes_count, pre_conv_modes_count, reset_conv(), sError, state, TRUE, and Opie::MM::x.

Referenced by CalculatorImpl().

void CalculatorImpl::processStack int  op  )  [private]
 

Definition at line 548 of file calculatorimpl.cpp.

References acc, evalExpr(), FALSE, QValueList< T >::isEmpty(), num, Op::number, oAdd, Op::operation, operationStack, oPercent, oSub, oSum, percent(), QValueStack< T >::pop(), QValueStack< T >::top(), and TRUE.

Referenced by execOp().

void CalculatorImpl::reset_conv  )  [private]
 

Definition at line 430 of file calculatorimpl.cpp.

References changeable_func_button_count, func_buttons, last_conversion, and Opie::MM::x.

Referenced by clear(), and function_button().

void CalculatorImpl::std_buttons int   )  [slot]
 

Definition at line 443 of file calculatorimpl.cpp.

References execOp(), oSum, sError, and state.

Referenced by CalculatorImpl(), and eventFilter().

void CalculatorImpl::std_funcs int   )  [slot]
 

Definition at line 450 of file calculatorimpl.cpp.

References changeable_func_button_count, current_mode, execOp(), oCloseBrace, oOpenBrace, oSin, pre_conv_modes_count, sError, and state.

Referenced by CalculatorImpl().


Member Data Documentation

double CalculatorImpl::acc [private]
 

Definition at line 101 of file calculatorimpl.h.

Referenced by clear(), command_buttons(), do_convert(), enterNumber(), evalExpr(), and processStack().

QButtonGroup CalculatorImpl::bgr_command [private]
 

Definition at line 124 of file calculatorimpl.h.

Referenced by CalculatorImpl().

QButtonGroup CalculatorImpl::bgr_digits [private]
 

Definition at line 124 of file calculatorimpl.h.

Referenced by CalculatorImpl().

QButtonGroup CalculatorImpl::bgr_function [private]
 

Definition at line 124 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and function_button().

QButtonGroup CalculatorImpl::bgr_std [private]
 

Definition at line 124 of file calculatorimpl.h.

Referenced by CalculatorImpl().

QStringList CalculatorImpl::captions [private]
 

Definition at line 125 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and function_button().

const int CalculatorImpl::changeable_func_button_count = 10 [static, private]
 

Definition at line 121 of file calculatorimpl.h.

Referenced by do_convert(), function_button(), reset_conv(), and std_funcs().

int CalculatorImpl::conversion_mode_count [private]
 

Definition at line 112 of file calculatorimpl.h.

Referenced by CalculatorImpl().

int CalculatorImpl::current_mode [private]
 

Definition at line 112 of file calculatorimpl.h.

Referenced by CalculatorImpl(), do_convert(), eventFilter(), function_button(), and std_funcs().

double* CalculatorImpl::entry_list [private]
 

Definition at line 128 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and do_convert().

QStringList CalculatorImpl::faces [private]
 

Definition at line 125 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and function_button().

QString CalculatorImpl::fake [private]
 

Definition at line 109 of file calculatorimpl.h.

Referenced by clear(), command_buttons(), and enterNumber().

bool CalculatorImpl::flPoint [private]
 

Definition at line 103 of file calculatorimpl.h.

Referenced by clear(), command_buttons(), enterNumber(), and execOp().

const int CalculatorImpl::func_button_count = 12 [static, private]
 

Definition at line 119 of file calculatorimpl.h.

Referenced by CalculatorImpl(), do_convert(), and function_button().

QPushButton* CalculatorImpl::func_buttons[func_button_count] [private]
 

Definition at line 122 of file calculatorimpl.h.

Referenced by CalculatorImpl(), display_pixmap_faces(), function_button(), and reset_conv().

int CalculatorImpl::last_conversion [private]
 

Definition at line 112 of file calculatorimpl.h.

Referenced by CalculatorImpl(), do_convert(), function_button(), and reset_conv().

int CalculatorImpl::max_mode [private]
 

Definition at line 112 of file calculatorimpl.h.

Referenced by CalculatorImpl(), do_convert(), and function_button().

double CalculatorImpl::mem [private]
 

Definition at line 101 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and command_buttons().

QLabel* CalculatorImpl::memMark [private]
 

Definition at line 108 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and command_buttons().

double CalculatorImpl::num [private]
 

Definition at line 101 of file calculatorimpl.h.

Referenced by clear(), command_buttons(), do_convert(), enterNumber(), evalExpr(), execOp(), and processStack().

int CalculatorImpl::numDecimals [private]
 

Definition at line 102 of file calculatorimpl.h.

Referenced by clear(), command_buttons(), enterNumber(), and execOp().

int CalculatorImpl::numOpenBraces [private]
 

Definition at line 104 of file calculatorimpl.h.

Referenced by clear(), and execOp().

QPixmap CalculatorImpl::oneoverx [private]
 

Definition at line 134 of file calculatorimpl.h.

QValueStack<Op> CalculatorImpl::operationStack [private]
 

Definition at line 98 of file calculatorimpl.h.

Referenced by clear(), execOp(), and processStack().

const int CalculatorImpl::post_conv_modes_count = 0 [static, private]
 

Definition at line 116 of file calculatorimpl.h.

Referenced by CalculatorImpl(), do_convert(), and function_button().

double* CalculatorImpl::postoffset_list [private]
 

Definition at line 130 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and do_convert().

const int CalculatorImpl::pre_conv_modes_count = 1 [static, private]
 

Definition at line 115 of file calculatorimpl.h.

Referenced by CalculatorImpl(), do_convert(), eventFilter(), function_button(), and std_funcs().

double* CalculatorImpl::preoffset_list [private]
 

Definition at line 129 of file calculatorimpl.h.

Referenced by CalculatorImpl(), and do_convert().

int CalculatorImpl::state [private]
 

Definition at line 99 of file calculatorimpl.h.

Referenced by clear(), command_buttons(), do_convert(), enterNumber(), evalExpr(), eventFilter(), execOp(), function_button(), std_buttons(), and std_funcs().

QPixmap CalculatorImpl::xtopowerofy [private]
 

Definition at line 132 of file calculatorimpl.h.

QPixmap CalculatorImpl::ythrootofx [private]
 

Definition at line 133 of file calculatorimpl.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:27:49 2005 for OPIE by  doxygen 1.4.2