/*
*
* Created on: Jul 25, 2011
* Author: abhishek
*/
/** \class SPAttributeRelCSS
*
* SPAttributeRelCSS class stores the mapping of element->style_properties
* relationship and provides a static function to access that
* mapping indirectly(only reading).
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <fstream>
#include <sstream>
#include <string>
#include <iostream>
#include "attribute-rel-css.h"
#include "path-prefix.h"
#include "preferences.h"
/*
* This function checks whether an element -> CSS property pair
* is allowed or not
*/
{
}
// Always valid if data file not found!
if( !foundFileProp ) return true;
// Strip of "svg:" from the element's name
}
// Don't check for properties with -, role, aria etc. to allow for more accessbility
// FixMe: Name space list should be created when file read in.
if (property[0] == '-'
return true;
} else {
//g_warning( "Invalid attribute: %s used on <%s>", property.c_str(), element.c_str() );
return false;
}
}
/*
* This function checks whether an CSS property -> default value
* pair is allowed or not
*/
{
}
// Always false if data file not found!
if( !foundFileDefault ) return false;
return true;
} else {
return false;
}
}
/*
* Check if property can be inherited.
*/
{
}
// Always false if data file not found!
if( !foundFileDefault ) return false;
}
/*
* Check if attribute is a property.
*/
{
}
// Always true if data file not found!
if( !foundFileProp ) return true;
}
{
// Read data from standard path
filepath += "/cssprops";
// Try and load data from filepath
foundFileProp = true;
}
// Read data from standard path
filepath += "/css_defaults";
// Try and load data from filepath
foundFileDefault = true;
}
}
{
// Display warning for file not open
g_warning("Could not open the data file for CSS attribute-element map construction: %s", fileName.c_str());
return false;
}
if (s.size() > 0 && s[0] != '\n') {
ss << s;
// Load data to structure that holds element -> set of CSS props
element = s;
}
// Load data to structure that holds CSS prop -> default value
value = s;
inherit = true;
}
}
}
}
return true;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :